Page 1 of 1

counting token to do minis

Posted: Thu Jul 25, 2013 11:40 am
by kuripot
how i can use this as single onload... i want to check Phirius Token Coins either to do daily quest or do minigame... as lvl 50 i can do only cot and at so need 60 Phirius Token Coins.. i want my character check Phirius Token Coins and if 60 pcs inventory will load loadPaths("jumptocot") or else do daily quest

Code: Select all

		if 60 < inventory:itemTotalCount(203038) then
			print("Enough Phirius Token Coins.")
			logentry = "Enough Phirius Token Coins."
			loadPaths("jumptocot")
			return
		end
	end

Re: counting token to do minis

Posted: Thu Jul 25, 2013 1:08 pm
by rock5
What's the the difficulty? Just do what you said, put it in a wp onload.

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints type="TRAVEL">
<onLoad>
      if 60 <= inventory:itemTotalCount(203038) then
         print("Enough Phirius Token Coins.")
         loadPaths("jumptocot")
      else
         print("Not enough Phirius Token Coins.")
         loadPaths("your_daily")
      end
</onLoad>
</waypoints>

Re: counting token to do minis

Posted: Thu Jul 25, 2013 6:42 pm
by kuripot
what is this mean?? equal and more than 60??

Code: Select all

<=
and what the purpose of this??

Code: Select all

logentry = "Enough Phirius Token Coins."

Re: counting token to do minis

Posted: Thu Jul 25, 2013 8:49 pm
by C3PO
it means 60 or more

Without knowing the code from that you have "logentry" it's just a guess that it was the message that was "later" written to a log file

Re: counting token to do minis

Posted: Fri Jul 26, 2013 1:31 am
by rock5
That's correct. You had only "60 <" but of course 60 is enough to do the minigames so I added the "=" so that it would also do the minigames when you have exactly 60 coins. ie. if 60 is less than or equal to the number of coins in your inventory then

Re: counting token to do minis

Posted: Fri Jul 26, 2013 1:43 am
by lisa
Since he asked what logentry was I would say he just copy pasted the code from elsewhere but doesn't really understand how or why it works.

Use the code rock posted for you.

Re: counting token to do minis

Posted: Fri Jul 26, 2013 8:27 pm
by kuripot
rock i got invalid token
line:49
column:14
pos:1984

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
	startGMDetect()
	changeProfileOption("LOOT_ALL","false")

	--== User Option ==--

	Deliver = 0         -- Change if you want to enable/disable deliver quests  0=disable, any number = deliver after that amount of eggs (must b bigger than 9)
	LagTime = 0           -- Affects accepting/completing quests. Increase LagTime if time is wasted by repeated CompleteQuests or AcceptQuests.
	RunningSpeed = 59    -- The speed the character runs when not teleporting. 50 is normal. Recommended 100.
	UseTeleporter = false  -- Use Jduratedj's teleport userfunction. Please make sure you have it installed to use this option.
	Timeout = 300         -- Time hens and eggs stay in the ignore list before being given another chance. '0' disables it, remains permanently in ignore list.
	debugging = true      -- Set to true to display extra useful information regarding egg drop rates and ignore lists.

	--=================--



	   local dailycomplete_ptr = 0x9CD1E0;
	   local dailycomplete_offset = 0xACF4;
   
	   function getDailyComplete()
	      return memoryReadBytePtr(getProc(),dailycomplete_ptr,dailycomplete_offset);
	   end
   
	   function checkDQCount()
	    local dailyQuestCount, dailyQuestsPerDay= RoMScript("Daily_count()")
	      cprintf(cli.lightblue,"%s quests completed.\n",tostring(dailyQuestCount));
	      if (dailyQuestCount == 10) then
	         cprintf(cli.lightblue,"Completed max number of daily quests, trying to use a daily reset card.\n");
	         inventory:update();
	         player:update();
	         -- note #202434 is the daily reset card
	            if inventory:itemTotalCount(202434) > 0 then
	                  inventory:useItem(202434);
	         else
			loadPaths("aimetocot")
	            end
	       end   
	   end

	function quest()
	   local queststate = getQuestStatus("My Skin Is Suffering")
	   if queststate == "complete" then
		__WPL:findWaypointTag("end")
	   end
	end

      if 60 <= inventory:itemTotalCount(203038) then
         print("Enough Phirius Token Coins.")
         loadPaths("aimetocot")
      else
         print("Not enough Phirius Token Coins.")
         loadPaths("aime")
      end
</onLoad>
this onload are from aime.xml wp

Re: counting token to do minis

Posted: Fri Jul 26, 2013 8:51 pm
by lisa
bot sometimes has issues with using < in code, just do it the other way around.

Code: Select all

if inventory:itemTotalCount(203038) => 60 then

Re: counting token to do minis

Posted: Sat Jul 27, 2013 1:58 am
by rock5
lisa wrote:bot sometimes has issues with using < in code
In xml files to be more specific. There is more than one way to deal with this problem but the easiest is what Lisa said; just flip it around.