My new project: Pet feeding menu system

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
kanta
Posts: 424
Joined: Thu Nov 11, 2010 4:08 pm

My new project: Pet feeding menu system

#1 Post by kanta »

Ok, I'm getting tired of working on farming waypoint files right now so I'm gonna try something different. I'm making a sort of menu driven waypoint file for different pet feeding options. I know a lot of you sell the golden eggs and/or Miller's Cakes but some of us use them and the unending amount of clicks can get on my nerves. Add that onto trading in eggs for potions and it's a tedious task. I'm hoping that this will work and remove that annoyance.

Just started so it doesn't do too much yet, I've started with the easiest thing first. Get the menu choices to work and be able to navigate between them all. Then for testing to be sure the functions would work I stuck in the code on a menu option to feed all Miller's Cakes to the pet of my choosing (from a menu of course). The good news? It works. The bad? Now I have to figure out the rest.

Quick question. I'd like to have one of the menu options give a choice to enter a custom amount of food to feed. How would I change the following code to accept the value a user inputs?

Code: Select all

mypet:feed(204791, "all")
Never mind, I figured it out. Anyway, getting late I gotta get some sleep.
Scout/Knight/Rogue 70/66/66
kanta
Posts: 424
Joined: Thu Nov 11, 2010 4:08 pm

Re: My new project: Pet feeding menu system

#2 Post by kanta »

Ok, I've run into a snag. I can't seem to figure out how to pull the info for the pet that I need. Will the following code update the information needed to pull values like current pet experience, training points, etc? It is, of course, not the full code so if you need the whole thing just let me know.

Code: Select all

  if 6 >= WhichPet then
  	WhichPet = CEggPet(WhichPet)
  	WhichPet:update()
I have this code in there right now and it's not returning any errors but that's no guarantee I'm doing it correctly.

How would I then pull the current chosen egg aptitude/training/exp values to work with them? Would I use WhichPet.Training? Such as

Code: Select all

if WhichPet.Training >= 500 then
or is that completely the wrong way to do it?
Scout/Knight/Rogue 70/66/66
User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: My new project: Pet feeding menu system

#3 Post by lisa »

those snippets of code you posted should work. I'd personally change the name though when it's no longer the pet slot number.

Code: Select all

  if 6 >= WhichPet then
     chosenpet = CEggPet(WhichPet)
     chosenpet:update()
  end


if chosenpet.Training >= 500 then
--use pot to increase talent points
end
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
kanta
Posts: 424
Joined: Thu Nov 11, 2010 4:08 pm

Re: My new project: Pet feeding menu system

#4 Post by kanta »

Good idea on the name change, thank you. Burning a few brain cells trying to figure this out and didn't even think of that.

Yes, it did work. I'm pretty surprised.... I'm just winging it here, trying to figure out code from different files. Here's what I ended up with:

Code: Select all

		if ChosenPet.Training >= 500 and inventory:itemTotalCount(204792) >= 2 then
			player:target_NPC("Pykesile")
			sendMacro("ChoiceOption(3)") yrest(1000)
			sendMacro("ChoiceOption(2)") yrest(1000)
			ChosenPet:feed(204927)
			else
				cprintf(cli.red,"\n\n		Not enough training and/or golden eggs\n")
			end
Scout/Knight/Rogue 70/66/66
User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: My new project: Pet feeding menu system

#5 Post by lisa »

aslong as the ID's match up that looks pretty good to me, it should use up 500 training and get 100 talent.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
kanta
Posts: 424
Joined: Thu Nov 11, 2010 4:08 pm

Re: My new project: Pet feeding menu system

#6 Post by kanta »

Yup. The check works. If you don't have at least 500 training points or 2 golden eggs, then it gives the error message I specified and returns to the egg choice section of the menu.

I've gotten a little further with it now so that you can get the enhancement potions singly or set an amount and it will keep trading eggs until the specified amount is reached where it then has the pet eat them all.
Scout/Knight/Rogue 70/66/66
User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: My new project: Pet feeding menu system

#7 Post by lisa »

so are you making it an ingame addon with the drop down menu's? or is this a web collaberation with MM?

I figure would be easy enough to make it as a function with arguments to tell it which egg slot and what to use.

Code: Select all

function petcare(arg1,arg2,arg3)
-- arg1 = pet slot
-- arg2 = what to purchase & use from egg vendor
-- arg3 = use golden eggs or not, so can use golden eggs to get training up.
that kind of thing
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
kanta
Posts: 424
Joined: Thu Nov 11, 2010 4:08 pm

Re: My new project: Pet feeding menu system

#8 Post by kanta »

Almost done with the main coding, I'll probly put it up tonight so you can see what I'm doing.
Scout/Knight/Rogue 70/66/66
kanta
Posts: 424
Joined: Thu Nov 11, 2010 4:08 pm

Re: My new project: Pet feeding menu system

#9 Post by kanta »

Ok, I'm done with the coding for now, you can try it out and let me know if you like it or think changes should be made. The coding is a bit dirty but it works.

http://www.solarstrike.net/phpBB3/viewt ... =27&t=2572
Scout/Knight/Rogue 70/66/66
Post Reply