Script to do a waypoint if the EOJ timer doesn't show?
Script to do a waypoint if the EOJ timer doesn't show?
I was just wondering.... Since sometimes the Timer for the EOJ events doesn't show (or disappears while waiting for an event), and you have to move to a different area to make it show again. Is there a way to have the bot monitor the event, and when the timer disappears, you can send your character to a certain waypoint and wait till the timer reappears and then go back to the original spot to continue waiting for the event to start? This would help me greatly, as it's quite annoying when the event timer disappears.
Re: Script to do a waypoint if the EOJ timer doesn't show?
If you are using any particular EOJ script, it would have helped if you had posted this question there.
Of course you can do what you asked. Like you said, if the timer isn't visible, move to a certain location and wait for it to appear. How you would include the code would depend on the script you used.
Of course you can do what you asked. Like you said, if the timer isn't visible, move to a certain location and wait for it to appear. How you would include the code would depend on the script you used.
- 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
Re: Script to do a waypoint if the EOJ timer doesn't show?
I was using the waypoint found in ( http://www.solarstrike.net/phpBB3/viewt ... =27&t=3890 ). I just found that at times the timer disappears, and wanted the bot to move to another spot not far away, to where the zone # changes and the timer reappears.
Re: Script to do a waypoint if the EOJ timer doesn't show?
There were a lot of scripts in that topic. Please in future, use a link to the actual post that you want to refer to. There is a little icon on the left of each posts title that has the link for that post.
Anyway, seeing as we are talking about timers, I'm assuming you are referring to this post, as I believe it's the only one using the timer.
http://www.solarstrike.net/phpBB3/viewt ... 019#p40019 Is that right?
First thing I want to ask you, though, is doesn't it work when the timer isn't visible?
Anyway, seeing as we are talking about timers, I'm assuming you are referring to this post, as I believe it's the only one using the timer.
http://www.solarstrike.net/phpBB3/viewt ... 019#p40019 Is that right?
First thing I want to ask you, though, is doesn't it work when the timer isn't visible?
- 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
Re: Script to do a waypoint if the EOJ timer doesn't show?
I did some experiments with PE_GetInfo(1). PE_GetInfo(1) does return only nil's as soon as the timer disappears.First thing I want to ask you, though, is doesn't it work when the timer isn't visible?
Code: Select all
function waitForEventStart()
repeat
yrest(1000) -- check every second
local namePE,messagePE,namePH,ScorePE,Count , IsScoreVisible= RoMScript("PE_GetInfo(1)")
if Count == 2 and YourTargetScore > ScorePE then break end
until false
end
Code: Select all
YourTargetScore > ScorePE
Re: Script to do a waypoint if the EOJ timer doesn't show?
Actually, if "PE_GetInfo(1) does return only nil's as soon as the timer disappears" then if ScorePE is nil, Count will also be nil. When "Count == 2" returns false, it wont bother doing the rest of that statement. The opposite is true with or statements. If the first part is true, it doesn't bother with the rest.Jandrana wrote:I didn't use this script, but I expect it to cause an error, when comparingCode: Select all
if Count == 2 and YourTargetScore > ScorePE then break end
and ScorePE is nil.Code: Select all
YourTargetScore > ScorePE
Lua is fun that way. You can do fun things with it. For example, instead of assigning an initial value of 0 to a counter variable you could do this, (Note: when dealing with values instead of comparisons, it returns the last value dealt with.)
Code: Select all
repeat
count = (count or 0) + 1
. . . Do stuff
until count == 10
End of lesson. Hope you found it useful.
- 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
Re: Script to do a waypoint if the EOJ timer doesn't show?
http://www.solarstrike.net/phpBB3/viewt ... 019#p40019 is the particular script I'm running. I just want it to check every once and a while to see if the timer is visible, and if it's not, to move to a nearby location to make the timer show again.
Re: Script to do a waypoint if the EOJ timer doesn't show?
That file was a bit messed up so I had to fix it a bit.
And at the last waypoint add
If you want me to explain any changes I made, just ask. Obviously this has not been tested as I don't have access to the new zone.
Now to finish it off, use createpath to create a path from the home base to the waiting spot and then back. Copy the waypoints to the end of the file above (above the <waypoints> tag obviously). Add the following code to the waiting waypoint
Code: Select all
repeat
yrest(5000)
until PEFisVisible()
Code: Select all
__WPL:setWaypointIndex(__WPL:findWaypointTag("Home Base"));
- 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
Re: Script to do a waypoint if the EOJ timer doesn't show?
if you get an error, it's only because rock made a little spell mistake:
retuen false has to be return false
Code: Select all
return true
else
retuen false
end
end
Re: Script to do a waypoint if the EOJ timer doesn't show?
I'm famous for them. LoLAlterEgo95 wrote:if you get an error, it's only because rock made a little spell mistake:
- 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
Re: Script to do a waypoint if the EOJ timer doesn't show?
Yeah, legendary mistakesrock5 wrote:I'm famous for them. LoL
Thankfully you do much more correct
Re: Script to do a waypoint if the EOJ timer doesn't show?
rock5 wrote:That file was a bit messed up so I had to fix it a bit.Now to finish it off, use createpath to create a path from the home base to the waiting spot and then back. Copy the waypoints to the end of the file above (above the <waypoints> tag obviously). Add the following code to the waiting waypointAnd at the last waypoint addCode: Select all
repeat yrest(5000) until PEFisVisible()
If you want me to explain any changes I made, just ask. Obviously this has not been tested as I don't have access to the new zone.Code: Select all
__WPL:setWaypointIndex(__WPL:findWaypointTag("Home Base"));
Hi Rock! I'm sorry i got confused about this. Well i'd like to refer to this post. I had a timer-bug few days back but after the server maintenance the bug never happened again. What i want is similar to this..I wanted to add another waypoint that would take me far from this area as my Home Base (while waiting for the event to start again). However i don't want to include that Home-Base to my loop as that would just prolong the process. I tried to alter the waypoint 4 and changed it to another waypoint away from the Flame area but when i run the bot it also got included in the loop. I was reading the rom-wiki but i didn't read about making waypoint tags. I hope you could enlighten me.
Thanks!
Re: Script to do a waypoint if the EOJ timer doesn't show?
a little off topic.
if you want to go to merchant tag then
the tags themselves can be named anything you want.
So if you want it to go to the merchant tag when you reach the Main tag spot then do
Code: Select all
<!-- # 3 --><waypoint x="4016" z="3172" tag="merchant"></waypoint>
<!-- # 4 --><waypoint x="3948" z="3107" tag="Main"></waypoint>
Code: Select all
__WPL:setWaypointIndex(__WPL:findWaypointTag("merchant"));
So if you want it to go to the merchant tag when you reach the Main tag spot then do
Code: Select all
<!-- # 3 --><waypoint x="4016" z="3172" tag="merchant"></waypoint>
<!-- # 4 --><waypoint x="3948" z="3107" tag="Main">
__WPL:setWaypointIndex(__WPL:findWaypointTag("merchant"))
</waypoint>
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
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: Script to do a waypoint if the EOJ timer doesn't show?
Hi Lisa! thanks for the response. Here is an example waypoint.lisa wrote:a little off topic.if you want to go to merchant tag thenCode: Select all
<!-- # 3 --><waypoint x="4016" z="3172" tag="merchant"></waypoint> <!-- # 4 --><waypoint x="3948" z="3107" tag="Main"></waypoint>
the tags themselves can be named anything you want.Code: Select all
__WPL:setWaypointIndex(__WPL:findWaypointTag("merchant"));
So if you want it to go to the merchant tag when you reach the Main tag spot then doCode: Select all
<!-- # 3 --><waypoint x="4016" z="3172" tag="merchant"></waypoint> <!-- # 4 --><waypoint x="3948" z="3107" tag="Main"> __WPL:setWaypointIndex(__WPL:findWaypointTag("merchant")) </waypoint>
Code: Select all
<?xml version="1.0" encoding="utf-8"?><waypoints type="TRAVEL">
<onload>
function waitForEventStart()
repeat
yrest(1000) -- check every second
local namePE,messagePE,namePH,ScorePE,Count , IsScoreVisible= RoMScript("PE_GetInfo(1)")
if Count == 2 and YourTargetScore > ScorePE then break end
until false
end
function isEventFinished()
local namePE,messagePE,namePH,ScorePE,Count , IsScoreVisible= RoMScript("PE_GetInfo(1)")
if Count ~= 2 or ScorePE >= YourTargetScore then
__WPL:setWaypointIndex(__WPL:findWaypointTag("Home Base"));
end
end
</onload>
<!-- # 1 --><waypoint x="-21868" z="-22936" y="588"> player:mount();
player:target_NPC("Diandon");
CompleteQuestByName("Extinguish More Flames");
</waypoint>
<!-- # 2 --><waypoint x="-21654" z="-22933" y="592"> </waypoint>
<!-- # 3 --><waypoint x="-21735" z="-23923" y="588">
queststate = getQuestStatus("Extinguish More Flames");
while queststate == "incomplete" do
yrest(1000);player:target_Object("Strange Flame Seedling");yrest(1000);
queststate = getQuestStatus("Extinguish More Flames");
end
</waypoint>
<!-- # 4 --><waypoint x="-21628" z="-22927" y="592" > </waypoint>
<!-- # 5 --><waypoint x="-21517" z="-23111" y="587" tag="Home Base">
waitForEventStart()
if (isEventFinished()) then
__WPL:setWaypointIndex(__WPL:findWaypointTag("Home Base"));
end
</waypoint>
</waypoints>
Code: Select all
function waitForEventStart()
Last edited by vo2male on Fri Sep 28, 2012 3:43 am, edited 1 time in total.
Re: Script to do a waypoint if the EOJ timer doesn't show?
First you close the loop by adding this to waypoint 4.
Now it will go from waypoint 4 to waypoint 1, excluding waypoint 5.
It looks like it's supposed to go to 5 from 1 so at waypoint one you have to make some sort of decision whether to go to waypoint 5. I'm not sure what that decision is. Maybe if the event is finished or if the PEF frame isn't visible?
So you would add something like this to waypoint 1.Probably after you have turned in the quest (BTW you haven't added an accept quest command. I'd just add it after the CompletQuestByName command). If those conditions aren't meet ie. you are still doing the quest, then it will keep going around the loop.
Then at waypoint 5 you want to wait for the event to start and then go back to waypoint 1. If I understand correctly, the PEF frame should reappear when you go to wp 5 so we might not need to add a check for it. So at waypoint 5 I'd just addBecause waypoint 1 comes after 5, because it's the last, we don't need to add a setWaypointIndex here.
I hope that's clear.
Code: Select all
__WPL:setWaypointIndex(1)
It looks like it's supposed to go to 5 from 1 so at waypoint one you have to make some sort of decision whether to go to waypoint 5. I'm not sure what that decision is. Maybe if the event is finished or if the PEF frame isn't visible?
So you would add something like this to waypoint 1.
Code: Select all
if isEventFinished() or RoMScript("PEFs:isVisible()") == false then -- under what conditions you want to go to waypoint 5.
__WPL:setWaypoint(__WPL:findWaypointTag("Home Base"))
end
Then at waypoint 5 you want to wait for the event to start and then go back to waypoint 1. If I understand correctly, the PEF frame should reappear when you go to wp 5 so we might not need to add a check for it. So at waypoint 5 I'd just add
Code: Select all
waitForEventStart()
I hope that's clear.
- 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
Re: Script to do a waypoint if the EOJ timer doesn't show?
Thankyou Rock! this is exactly what i neededrock5 wrote:First you close the loop by adding this to waypoint 4.Now it will go from waypoint 4 to waypoint 1, excluding waypoint 5.Code: Select all
__WPL:setWaypointIndex(1)
It looks like it's supposed to go to 5 from 1 so at waypoint one you have to make some sort of decision whether to go to waypoint 5. I'm not sure what that decision is. Maybe if the event is finished or if the PEF frame isn't visible?
So you would add something like this to waypoint 1.Probably after you have turned in the quest (BTW you haven't added an accept quest command. I'd just add it after the CompletQuestByName command). If those conditions aren't meet ie. you are still doing the quest, then it will keep going around the loop.Code: Select all
if isEventFinished() or RoMScript("PEFs:isVisible()") == false then -- under what conditions you want to go to waypoint 5. __WPL:setWaypoint(__WPL:findWaypointTag("Home Base")) end
Then at waypoint 5 you want to wait for the event to start and then go back to waypoint 1. If I understand correctly, the PEF frame should reappear when you go to wp 5 so we might not need to add a check for it. So at waypoint 5 I'd just addBecause waypoint 1 comes after 5, because it's the last, we don't need to add a setWaypointIndex here.Code: Select all
waitForEventStart()
I hope that's clear.
That is because i am using an addon auto accept and auto complete, forgot the name though.BTW you haven't added an accept quest command. I'd just add it after the CompletQuestByName command
ima try this out and keep you posted.. thanks again
EDIT:
btw what is
Code: Select all
__WPL:setWaypointIndex(1)
i'm not sure if i understood this correctly but is it possible that there would be index(2), index(3), etc..etc.. if i would want to incorporate multiple loops on my wp file?Set the waypoint # 'number' as next waypoint to reach
UPDATE: Thanks Rock! now it works fine so far.. you are right, i don't need a PEF Check on WP_5 because that is also one of the reason i wanted to have that waypoint 5. Pretty sure that this far, the timer will reappear whenever its bugged. And i also don't want to be staying and waiting there for the event to restart along with other botters. Lol it's just like a 1 big family picture!
Re: Script to do a waypoint if the EOJ timer doesn't show?
The loaded waypoints are stored in the table __WPL.vo2male wrote:btw what is
?Code: Select all
__WPL:setWaypointIndex(1)
__WPL:setWaypointIndex(index) is a function that sets the next waypoint it will go to as soon as it's finished with the current waypoint. If there are many waypoints then it's hard to tell which is which as the numbers might not match the index number. That's when we use tags.
__WPL:findWaypointTag("tag name") is a function that returns the index of the waypoint with a specific tag, that's one that is has a
Code: Select all
tag="tag name"
Code: Select all
__WPL:setWaypointIndex(__WPL:findWaypointTag("tag name"))
- 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
Re: Script to do a waypoint if the EOJ timer doesn't show?
Thanks Rock,
Was going to ask the same thing only difference being I wanted the script to start if the timer wasn't visible. (have found doing manually that timer appears after clicking the flame again but then it runs straight to wp 1 and gets stuck) I think I have managed to work it out unfortunately I cant test it yet (that quest very busy lately)
Was going to ask the same thing only difference being I wanted the script to start if the timer wasn't visible. (have found doing manually that timer appears after clicking the flame again but then it runs straight to wp 1 and gets stuck) I think I have managed to work it out unfortunately I cant test it yet (that quest very busy lately)
Re: Script to do a waypoint if the EOJ timer doesn't show?
Been trying to implement Rocks code but now get scripts\rom/bot.lua:824: Failed to compile and run Lua code for waypoint #2
Waypoint #2 code works using my other script that doesn't have this new function added.
Trying (with limited success) to get the bot to run the script if the timer isn't visible, i can get it to go for a walk elsewhere till the timer appears but i don't want to do that lol.
Waypoint #2 code works using my other script that doesn't have this new function added.
Trying (with limited success) to get the bot to run the script if the timer isn't visible, i can get it to go for a walk elsewhere till the timer appears but i don't want to do that lol.
Code: Select all
<onload>
--USER OPTIONS--
YourTargetScore = 6000
function waitForEventStart()
repeat
yrest(1000) -- check every second
local namePE,messagePE,namePH,ScorePE,Count , IsScoreVisible= RoMScript("PE_GetInfo(1)")
if Count == 2 and YourTargetScore > ScorePE then break end
until false
end
function isEventFinished()
local namePE,messagePE,namePH,ScorePE,Count , IsScoreVisible= RoMScript("PE_GetInfo(1)")
if Count ~= 2 or ScorePE >= YourTargetScore or not PEFisVisible() then
return true
else
return false
end
end
function PEFisVisible()
return RoMScript("PEFs:isVisible()")
end
</onload>
<!-- # 1 --><waypoint x="-21555" z="-22947" y="584" tag="Start">
waitForEventStart()
queststate = getQuestStatus("Extinguish More Flames");
if queststate == "complete" then
player:target_NPC("Diandon");
CompleteQuestByName("Extinguish More Flames");
yrest(300);
__WPL:setWaypointIndex(__WPL:findWaypointTag("Main"));
else
player:target_NPC("Diandon");
AcceptQuestByName("Extinguish More Flames","Diandon");
yrest(300);
if isEventFinished() or RoMScript("PEFs:isVisible()") == false then
__WPL:setWaypointIndex(__WPL:findWaypointTag("Start"));
end
</waypoint>
<!-- # 2 --><waypoint x="-21684" z="-23224" y="581">
queststate = getQuestStatus("Extinguish More Flames");
while queststate == "incomplete" then
yrest(50);player:target_Object("Strange Flame Seedling");yrest(50);
queststate = getQuestStatus("Extinguish More Flames");
end
</waypoint>
</waypoints>
Re: Script to do a waypoint if the EOJ timer doesn't show?
The numbering can be off sometimes. I think it counts the onload as a waypoint. So when it says "waypoint #2" it might mean waypoint 1. And I can see waypoint 1 has 2 'if' statements but only 1 '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.”
- Ronald Reagan
Who is online
Users browsing this forum: No registered users and 0 guests