Page 1 of 1
Guild Resourses
Posted: Mon Nov 11, 2013 9:55 am
by ZZZZZ
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

Re: Guild Resourses
Posted: Mon Nov 11, 2013 11:36 am
by rock5
Re: Guild Resourses
Posted: Mon Nov 11, 2013 12:08 pm
by ZZZZZ
yes! Thank you.
Re: Guild Resourses
Posted: Fri Nov 22, 2013 6:55 am
by ZZZZZ
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.
Re: Guild Resourses
Posted: Fri Nov 22, 2013 7:02 am
by rock5
Dunno. It doesn't seem to be used anywhere in the interface.fdb. Couldn't you just check your starting location?
Re: Guild Resourses
Posted: Fri Nov 22, 2013 7:05 am
by ZZZZZ
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.
Re: Guild Resourses
Posted: Fri Nov 22, 2013 7:37 am
by rock5
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.
Re: Guild Resourses
Posted: Fri Nov 22, 2013 8:36 am
by ZZZZZ
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
Re: Guild Resourses
Posted: Fri Nov 22, 2013 8:49 am
by rock5
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))
Re: Guild Resourses
Posted: Fri Nov 22, 2013 9:07 am
by ZZZZZ
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
?
Re: Guild Resourses
Posted: Fri Nov 22, 2013 9:21 am
by rock5
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
Re: Guild Resourses
Posted: Fri Nov 22, 2013 10:10 am
by ZZZZZ
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.
Re: Guild Resourses
Posted: Fri Nov 22, 2013 10:31 am
by rock5
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.
Re: Guild Resourses
Posted: Fri Nov 22, 2013 12:28 pm
by ZZZZZ
Ok i'll try it next siege, thanks R5.