Tag OnLoad?

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
User avatar
Lamkefyned
Posts: 348
Joined: Thu May 23, 2013 11:38 am
Location: Spain

Tag OnLoad?

#1 Post by Lamkefyned » Wed Sep 10, 2014 9:56 am

hi,

I have this script:(LUA)

Code: Select all

-- LVersion 1.16

	setExecutionPath(getExecutionPath().."/..")

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

	cprintf(cli.red,"\n\n Load DTG Waypoints \n\n")
	yrest(500)
	clearDG()
     
--=================--

	if getZoneId() == 6 then
		clearDG()
		cprintf(cli.lightblue,"\n  ZONE ID : %s \n\n", getZoneId())
		travelDG("ObsidianCastle")
		player:target_NPC(NPCGuild)
		sendMacro("ChoiceOption(2);");
		waitForLoadingScreen()
	end

--=================--
     
	if getZoneId() == 401 then
		clearDG()
		cprintf(cli.lightblue,"\n  ZONE ID : %s \n\n", getZoneId())
		GotoGuild("Drill Ground")
		player:target_Object("Drill Ground");
		sendMacro("ChoiceOption(1);");
		waitForLoadingScreen()
	end

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

	if getZoneId() == 354 then
		clearDG()

		if MaxHonor > getCurrency("honor") then
		 repeat
			cprintf(cli.lightblue,"\n  ZONE ID : %s \n", getZoneId())
			cprintf(cli.lightgreen,"\n    -- TOTAL HONOR : %s \n\n", comma_valueDG(getCurrency("honor")))
			fly()
			player:moveTo(CWaypoint(5121,2515,13),true)
			player:moveTo(CWaypoint(5121,2651,111),true)
			player:moveTo(CWaypoint(4754,2954,430),true)
			player:moveTo(CWaypoint(2609,4302,430),true)
			player:moveTo(CWaypoint(2120,4644,13),true)
			player:moveTo(CWaypoint(2665,4160,430),true)
			player:moveTo(CWaypoint(3443,4016,430),true)
			yrestsystemDG()
			clearDG()
         until getCurrency("honor") == MaxHonor
		else
			clearDG()
			flyoff()
			player:target_NPC(NPCID)
			sendMacro("ChoiceOption(7);");
			waitForLoadingScreen()
			checkgoldDG()
			GotoGuild("Guild Castle Transport Point")
			player:moveTo(CWaypoint(80,-568,6),true)
			acceptmessageDG()
			waitForLoadingScreen()
		end
	end

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

	if getZoneId() == 6 then
		clearDG()
		travelDG("MercenarySquare")
	end

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

	if getZoneId() == 6 then
		clearDG()
		cprintf(cli.lightblue,"\n  ZONE ID : %s \n\n", getZoneId())
		player:moveTo(CWaypoint(-22062,3654,-179),true)
		player:target_NPC(NPCStore)
		yrest(500)
		if StoreOption == 1 then
			sendMacro("ChoiceOption(1);");
		elseif StoreOption == 2 then
			sendMacro("ChoiceOption(2);");
		elseif StoreOption == 3 then
			sendMacro("ChoiceOption(3);");
		end
		yrest(1000)
		store:buyItem(ObjectBuy, AmountBuy)
		yrest(500)
		RoMScript("CloseAllWindows()")   
		GuildDonate("all", "green")
		yrest(1000)
	end

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

	clearDG()
	travelDG("ObsidianCastle")

--=================--
The question is ... how I can return to the top end of the waypoint?
If you think something is right just because everyone else believes,you're not thinking.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Tag OnLoad?

#2 Post by rock5 » Wed Sep 10, 2014 10:07 am

So this is a waypoint onload?

You could put the whole thing into a big loop. Or you could put the whole thing into a function and loop the function. Or you could just reload the waypoint file.

Code: Select all

loadPaths(__WPL.FileName)
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
Lamkefyned
Posts: 348
Joined: Thu May 23, 2013 11:38 am
Location: Spain

Re: Tag OnLoad?

#3 Post by Lamkefyned » Wed Sep 10, 2014 10:11 am

Prefer the loop function
If you think something is right just because everyone else believes,you're not thinking.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Tag OnLoad?

#4 Post by rock5 » Wed Sep 10, 2014 10:38 am

Code: Select all

repeat

   -- Your code

until SomeCondition
I don't know what condition you would use. When would you want it to stop? If you don't want it to stop you can just use "until false".
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

Maxalu
Posts: 19
Joined: Wed Jun 25, 2014 7:34 am

Re: Tag OnLoad?

#5 Post by Maxalu » Wed Sep 17, 2014 5:53 am

rock5 wrote:

Code: Select all

repeat

   -- Your code

until SomeCondition
I don't know what condition you would use. When would you want it to stop? If you don't want it to stop you can just use "until false".
i think the stop point would be when he has less then 1000 honor then

Code: Select all

 if MinHonor > getCurrency("honor") then
or smth like that

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Tag OnLoad?

#6 Post by rock5 » Wed Sep 17, 2014 6:12 am

In that case it would be

Code: Select all

repeat

   -- Your code

until 1000 > getCurrency("honor")
Or whatever value you wanted to use.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

Maxalu
Posts: 19
Joined: Wed Jun 25, 2014 7:34 am

Re: Tag OnLoad?

#7 Post by Maxalu » Wed Sep 17, 2014 7:28 am

thx it helped but i have 2 more question if i would like 2 buy and use the bought item and rebuy them if u have more than 1000 honor

Code: Select all

store:buyItem(x, y) 
then inventory:useItem(y) until inventory:useItem(y) ==0 
 if 1000< getCurrency("honor") then ???
      yrest(500)
in other words i would like 2 use the bought items till i have 0 of it in my bag. The second question is are thouse comands: "clearDG()", "checkgoldDG()" are included in the bot coz I see them first time?

noobbotter
Posts: 527
Joined: Fri Aug 31, 2012 1:15 pm

Re: Tag OnLoad?

#8 Post by noobbotter » Wed Sep 17, 2014 2:32 pm

I think something like this is what you're looking for. This is untested:

Code: Select all

if getCurrency("honor") > 1000 then
	repeat
		store:buyItem(x, y) 
		yrest(500)
		repeat
			inventory:useItem(y) 
			yrest(200)
		until inventory:itemTotalCount(y) == 0 
	until 1000 > getCurrency("honor")
end

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Semrush [Bot] and 38 guests