-
ZZZZZ
- Posts: 513
- Joined: Sun Oct 21, 2012 1:42 am
#1
Post
by ZZZZZ » Mon Nov 11, 2013 9:55 am
Havn't been able to find anything so far about this, but have been looking for any way to determine which guild resource is the lowest, eg.
Code: Select all
guild = RoMScript("GetGuildInfo()")
if guild Herb > guild Wood and guild Ore > guild Wood then
--- get wood
elseif guild Wood > guild Herb and guild Ore > guild Herb then
---get herb
else
--- get ore
end
Not sure if its possible but hey, any advice would be great
![Smile :)](./images/smilies/icon_e_smile.gif)
-
rock5
- Posts: 12173
- Joined: Tue Jan 05, 2010 3:30 am
- Location: Australia
#2
Post
by rock5 » Mon Nov 11, 2013 11:36 am
- 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.”
-
ZZZZZ
- Posts: 513
- Joined: Sun Oct 21, 2012 1:42 am
#3
Post
by ZZZZZ » Mon Nov 11, 2013 12:08 pm
yes! Thank you.
-
ZZZZZ
- Posts: 513
- Joined: Sun Oct 21, 2012 1:42 am
#4
Post
by ZZZZZ » Fri Nov 22, 2013 6:55 am
Also wondering what info (API:GetGuildWarInfo) returns. I'm trying to figure out how to determine what side of siege you are on (blue side or red side) but am having no luck finding any functions other than the above that could be close to what i am after.
-
rock5
- Posts: 12173
- Joined: Tue Jan 05, 2010 3:30 am
- Location: Australia
#5
Post
by rock5 » Fri Nov 22, 2013 7:02 am
Dunno. It doesn't seem to be used anywhere in the interface.fdb. Couldn't you just check your starting location?
- 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.”
-
ZZZZZ
- Posts: 513
- Joined: Sun Oct 21, 2012 1:42 am
#6
Post
by ZZZZZ » Fri Nov 22, 2013 7:05 am
Ummm if you have 2 waypoints indexed with number 1, would using __WPL:setWaypointIndex(1) move it to the closest out of the 2? I'll test later if no one reply's.
-
rock5
- Posts: 12173
- Joined: Tue Jan 05, 2010 3:30 am
- Location: Australia
#7
Post
by rock5 » Fri Nov 22, 2013 7:37 am
The numbers in waypoint files are just comments. __WPL:setWaypointIndex(1) will send you to the first waypoint. Note: Normally, when starting a waypoint file, it will start at the nearest waypoint. So, for example, you could have 2 waypoint files in one.
Code: Select all
<!-- #1 --><waypoint x=.. z=.. y=.. tag="start1"></waypoint>
...
<!-- #20 --><waypoint x=.. z=.. y=.. >__WPL:setWaypointIndex(__WPL:findWaypointTag("start1"))</waypoint>
<!-- #21 --><waypoint x=.. z=.. y=.. tag="start2"></waypoint>
...
<!-- #40 --><waypoint x=.. z=.. y=.. >__WPL:setWaypointIndex(__WPL:findWaypointTag("start2"))</waypoint>
And depending on where you start it will use either one part or the other.
- 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.”
-
ZZZZZ
- Posts: 513
- Joined: Sun Oct 21, 2012 1:42 am
#8
Post
by ZZZZZ » Fri Nov 22, 2013 8:36 am
Im currently using:
Code: Select all
<onLoad>
__WPL:setWaypointIndex(1)
repeat
yrest(2000);
player:update();
zoneid=RoMScript("GetZoneID()");
until zoneid == 402
yrest(500);
</onLoad>
<!-- # 1 --><waypoint x="3600" z="86" y="1788"> </waypoint>
<!-- # 2 --><waypoint x="3452" z="103" y="1759"> </waypoint>
I had to add the index(1) because when loading outside siege it would load a random waypoint rather than No.1
-
rock5
- Posts: 12173
- Joined: Tue Jan 05, 2010 3:30 am
- Location: Australia
#9
Post
by rock5 » Fri Nov 22, 2013 8:49 am
That's because it calculates and sets the closest waypoint before the onload runs. You want it to calculate the closest waypoint after it arrives in zone 402. If you had started the waypoint file in zone 402 then it would find the correct closest waypoint but because you want to start the script outside you will have to calculate it yourself. You can do it like this.
Code: Select all
player:updateXYZ()
__WPL:setWaypointIndex(__WPL:getNearestWaypoint(player.X,player.Z,player.Y))
- 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.”
-
ZZZZZ
- Posts: 513
- Joined: Sun Oct 21, 2012 1:42 am
#10
Post
by ZZZZZ » Fri Nov 22, 2013 9:07 am
Ok, will give that a try thanks. If i load it that way, is there any way to do:
Code: Select all
if waypointtag == RED then
__WPL:setWaypointIndex(__WPL:findWaypointTag("REDRES"));
else
__WPL:setWaypointIndex(__WPL:findWaypointTag("BLUERES"));
end
?
-
rock5
- Posts: 12173
- Joined: Tue Jan 05, 2010 3:30 am
- Location: Australia
#11
Post
by rock5 » Fri Nov 22, 2013 9:21 am
Where do you get waypointtag and where do you get RED?
If you want to start at a particular waypoint we come back to my idea of checking your location. The castles are on the left and right, right? So if you can get an X value somewhere in the middle of the map then you can do
Code: Select all
player:updateXYZ()
if player.X > midX then
__WPL:setWaypointIndex(__WPL:findWaypointTag("BLUERES"));
else
__WPL:setWaypointIndex(__WPL:findWaypointTag("REDRES"));
end
- 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.”
-
ZZZZZ
- Posts: 513
- Joined: Sun Oct 21, 2012 1:42 am
#12
Post
by ZZZZZ » Fri Nov 22, 2013 10:10 am
sorry, using
Code: Select all
<!-- # 9 --><waypoint x="2601" z="137" y="1804" tag='Gatebuff'> Buffgates()
</waypoint>
<!-- # 10 --><waypoint x="3638" z="16" y="2076" tag='Return'>Checkleave() </waypoint> --- run back after res
I have 2 sets of waypoints, 1 for each red gate and 1 for each blue side gate. Would putting __WPL:setWaypointIndex(__WPL:getNearestWaypoint(player.X,player.Z,player.Y)) in like so work to load the 'return to gate' waypoint?
Code: Select all
function Buffgates()
gate = player:findNearestNameOrId(112064)
if gate then
player:target(gate.Address)
end
target = player:getTarget()
repeat
yrest(200);
if not target:hasBuff("High-Energy Barrier") then
RoMScript('CastSpellByName("High-Energy Barrier")')
end
until RoMScript("GetZoneID()") ~= 402 or not player.Alive
if RoMScript("GetZoneID()") ~= 402 then
player:sleep()
else
RoMScript("BrithRevive();");
waitForLoadingScreen(5)
yrest(5000)
------
player:updateXYZ()
__WPL:setWaypointIndex(__WPL:getNearestWaypoint(player.X,player.Z,player.Y))
------
end
end
Im just hoping to condense the 2 sets of way-points down into 1 so it is a lot easier to start them before siege.
-
rock5
- Posts: 12173
- Joined: Tue Jan 05, 2010 3:30 am
- Location: Australia
#13
Post
by rock5 » Fri Nov 22, 2013 10:31 am
That will continue the waypoint file from the closest waypoint wherever it is. If you have a waypoint near the revive location then it will continue from there.
- 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.”
-
ZZZZZ
- Posts: 513
- Joined: Sun Oct 21, 2012 1:42 am
#14
Post
by ZZZZZ » Fri Nov 22, 2013 12:28 pm
Ok i'll try it next siege, thanks R5.
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 0 guests