Need some Coding help

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
M4gm4
Posts: 137
Joined: Sun Jan 30, 2011 2:30 pm

Need some Coding help

#1 Post by M4gm4 » Thu Feb 09, 2012 1:41 pm

hi everybody,
I need a little help once again. It would be nice if someone could look at, or even a couple of ideas on its part.

#1
I think that can be made ​​shorter/compact, right?
I understand that with else and elseif, etc. are not quite sure when the event occurs. rather how it should look like exactly

Code: Select all

	<!-- # 36 --><waypoint x="1789" z="1717" y="399">
			 if inventory:itemTotalCount(0) == 0 then    
				 sendMacro("LeaveParty();");
				yrest(4000)
				 waitForLoadingScreen(); 
				 player:update();
				 __WPL:setWaypointIndex(__WPL:findWaypointTag("return"));
			 end 
			 if inventory:itemTotalCount(206879) >= 1000 then    -- max mementos
				 sendMacro("LeaveParty();");
				yrest(4000)
				 waitForLoadingScreen(); 
				 player:update();
				cprintf(cli.lightgreen,"\n          Maximum von 1000 Mementos erreicht\n");
				error("Closing.",0);
				--  __WPL:setWaypointIndex(__WPL:findWaypointTag("GoHome"));
			 end 
   
			player:target_Object(113570); -- Transportportal
  	    		yrest(500);
			sendMacro("ChoiceOption(1);");
			waitForLoadingScreen();
 	</waypoint> -- portal
#2
how can I check whether the mob is already down?
I would like to have such - rotation - check - if mob death - stop rotation - if mob alive - do rotation again
BUT!!! the mob goes friendly (green) when the fight iss over.

Code: Select all

		 mob = player:findNearestNameOrId(123456)
		 if mob then
			player:target(mob)
			player:cast("ROGUE_SHADOW_STEP")
			player:cast("ROGUE_SNEAK_ATTACK")
			player:cast("ROGUE_ASSASSINS_RAGE")
			player:cast("ROGUE_EVASION")
			player:target(mob)
			player:cast("ROGUE_KICK")
			player:cast("ROGUE_SHADOWSTAB")
			player:cast("ROGUE_LOW_BLOW")
			player:cast("ROGUE_WOUND_ATTACK")
			player:cast("ROGUE_SHADOWSTAB")
			player:cast("ROGUE_LOW_BLOW")
			player:cast("ROGUE_KICK")
                    end
regards and thanky , M4gm4
I use the google translator, so do not be surprised if my english is funny

M4gm4
Posts: 137
Joined: Sun Jan 30, 2011 2:30 pm

Re: Need some Coding help

#2 Post by M4gm4 » Fri Feb 10, 2012 9:49 am

#3
How I can load onto a waypointtag?

Code: Select all

loadPaths(mainwaypointfile)
to load mainwaypointfile.xml and start at a defined tag like tag="round2"
I use the google translator, so do not be surprised if my english is funny

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Need some Coding help

#3 Post by lisa » Fri Feb 10, 2012 11:19 am

you already have

Code: Select all

__WPL:setWaypointIndex(__WPL:findWaypointTag("return"));

in the code you posted, I guess you don't understand what it does?

Either way just use something similar in the onload of the WP file.
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

M4gm4
Posts: 137
Joined: Sun Jan 30, 2011 2:30 pm

Re: Need some Coding help

#4 Post by M4gm4 » Fri Feb 10, 2012 12:12 pm

nope...
ok, i have 4 waypointfiles ,,
1.xml -- main
2.xml -- do something loke daily
3.xm -- do something like farm
4.xml -- do something like whatever

1.xml has a waypoint with diffrent tags
wp 1 - 10 go to next station and loadPaths(2.xml)

if 2.xml finish , load 1.xml an go to tag wp 11-20, then loadPaths(3.xml)
etc. etc.

understand ?
I use the google translator, so do not be surprised if my english is funny

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

Re: Need some Coding help

#5 Post by rock5 » Fri Feb 10, 2012 12:31 pm

Try

Code: Select all

loadPaths(mainwaypointfile)
__WPL:setWaypointIndex(__WPL:findWaypointTag("pointonextsection"));
Even though it has loaded a new file, it will still execute the next line where you set the waypoint index.
  • 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

M4gm4
Posts: 137
Joined: Sun Jan 30, 2011 2:30 pm

Re: Need some Coding help

#6 Post by M4gm4 » Fri Feb 10, 2012 12:38 pm

rock5 wrote:Try

Code: Select all

loadPaths(mainwaypointfile)
__WPL:setWaypointIndex(__WPL:findWaypointTag("pointonextsection"));
Even though it has loaded a new file, it will still execute the next line where you set the waypoint index.
I can not test this at the moment,... but, that would be great if you could do that so

Code: Select all

loadPaths(mainwaypointfile,tag)
would please me so :)
I use the google translator, so do not be surprised if my english is funny

M4gm4
Posts: 137
Joined: Sun Jan 30, 2011 2:30 pm

Re: Need some Coding help

#7 Post by M4gm4 » Mon Feb 13, 2012 6:32 pm

Servus :)

ok, i have testet it, but i got problems with it...

i have edited survivalR5onload with

Code: Select all

	elseif When_Finished == "Feierabendrunde" then
		waitForLoadingScreen();	player:update();
		loadPaths("Minigames/Parqour_tele")
but when i come out from the survival, it loads the nearest waypoint fom my feierabendrunde.xml
the nearest waypoint is,,, to start survival^^ so the bot want to start survival agin ,, and not load the parqour_tele

in parqour_tele i have editet

Code: Select all

		elseif When_Finished == "Feierabendrunde" then
		player:target_NPC("Malatina"); yrest(1000); sendMacro("ChoiceOption(1);");
		waitForLoadingScreen();	player:update();
		loadPaths("Feierabendrunde")
		__WPL:setWaypointIndex(__WPL:findWaypointTag("GoRasa"));
I do not know if it's random, or it works. but it works,, he goes to buy diamonds , then port to rasa via the quest


here is the snippet from veranas of my feierabend script

Code: Select all

	<!-- #  1 --><waypoint x="2387" z="1143" y="10" tag="malatina">	</waypoint> -- Veranas Sturobold zu Malatinas
	<!-- #  2 --><waypoint x="2476" z="1124" y="23">	</waypoint>
	<!-- #  3 --><waypoint x="2585" z="1066" y="37">
		player:target_NPC("Lieve");	yrest(100);	sendMacro("ChoiceOption(2);");
		waitForLoadingScreen();	player:update(); -- zum stadtplatz porten
	</waypoint>
	<!-- #  6 --><waypoint x="4808" z="-1976" y="115"> loadPaths(MG2); </waypoint>
	<!-- #  7 --><waypoint x="4856" z="-1962" y="115">	</waypoint> -- vor malatina

	<!-- #  1 --><waypoint x="5042" z="-1976" y="103" tag="GoRasa">	</waypoint>
	<!-- #  2 --><waypoint x="5193" z="-2075" y="105">	</waypoint>
	<!-- #  3 --><waypoint x="5264" z="-2109" y="121">
				   player:target_NPC("Cedric"); sendMacro("ChoiceOption(1);"); yrest(500); -- Dias Kaufen
				   player:target_NPC("Cedric"); sendMacro("ChoiceOption(1);"); yrest(500);
				   player:target_NPC("Cedric"); sendMacro("ChoiceOption(1);"); yrest(500);
	</waypoint>
edit:

Code: Select all

	MG2 = "Minigames/survivalR5";
I use the google translator, so do not be surprised if my english is funny

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests