Page 1 of 1

How to record a value before running a waypoint?

Posted: Sun May 03, 2015 2:19 am
by sgk2015
Hi all,
Ive been trying rombot recently and having fun with it. I have a function like

Code: Select all

function checkgoal()
	if inventory:itemTotalCount(202849) == 12 then		<!-- how many mana stone 10 you want to make -->		
		cprintf(cli.yellow,"Target number of mana stone 10 needed to make reached, rest now...\n")		<!-- Notify status -->
		sendMacro("CloseAllWindows()");
		yrest(1000);
		RoMCode("MagicBoxFrame:Hide()");
		yrest(1000);
		player:sleep()
	else
		cprintf(cli.yellow,"Continuing...\n")		<!-- Notify status -->
	end
end
Currently I have to change to the number 12 everytime before i run the waypoint. Is there anyway to make it run like this:
- Run the waypoint
- It asks how many stone I want to make
- Enter a targeted number
- Then the bot starts

Thanks a lot :mrgreen:

Re: How to record a value before running a waypoint?

Posted: Sun May 03, 2015 3:00 am
by rock5
Mu invaders waypoint file does something like that. This is how it does it.

Code: Select all

		local BagsWanted
		repeat
			cprintf(cli.lightgreen,"\nPlease enter the number of bags you want to get\n")
			printf(" Number of bags> ")
			BagsWanted = io.stdin:read()
			BagsWanted = tonumber(BagsWanted)
			if type(BagsWanted) ~= "number" or 0 > BagsWanted then
				cprintf(cli.yellow,"\nExpecting number more than or equal to 0.\n")
				yrest(2000)
			end
		until type(BagsWanted) == "number" and BagsWanted >= 0

		return BagsWanted

Re: How to record a value before running a waypoint?

Posted: Sun May 03, 2015 4:56 am
by sgk2015
Thank you Rock, gonna try it out to see how it works. Hope I'll learn something :mrgreen: