Page 2 of 3
Re: Energy of Justice easily earned
Posted: Sun Jan 05, 2014 2:41 am
by ZZZZZ
whiskerbiscuit wrote:About 2 hours I was able to get a little over 1500 EOJ's.
How can you get 1500 eoj in a 'little' over 2 hours when using 1 character in the manner you say? it would take 14 hours to get that amount (35 max every 20 mins) lol.
Re: Energy of Justice easily earned
Posted: Sun Jan 05, 2014 6:48 pm
by whiskerbiscuit
ZZZZZ wrote:whiskerbiscuit wrote:About 2 hours I was able to get a little over 1500 EOJ's.
How can you get 1500 eoj in a 'little' over 2 hours when using 1 character in the manner you say? it would take 14 hours to get that amount (35 max every 20 mins) lol.
Probably because I had some already and didn't realize it.. so my bad. Either way it works. Only problem is you're pulling Wilderness stats... not exactly what you want. Been looking for a farm in Sarlo to pull better ones.
Re: Energy of Justice easily earned
Posted: Wed Jan 08, 2014 7:16 am
by hangman04
whiskerbiscuit wrote:ZZZZZ wrote:whiskerbiscuit wrote:About 2 hours I was able to get a little over 1500 EOJ's.
How can you get 1500 eoj in a 'little' over 2 hours when using 1 character in the manner you say? it would take 14 hours to get that amount (35 max every 20 mins) lol.
Probably because I had some already and didn't realize it.. so my bad. Either way it works. Only problem is you're pulling Wilderness stats... not exactly what you want. Been looking for a farm in Sarlo to pull better ones.
Well my advice is to farm 10000+ in that spot and afterwards go and win 1st manually in 80/82 area. This way you will have access to the top stats.
Re: Energy of Justice easily earned
Posted: Fri Jan 10, 2014 1:07 pm
by noobbotter
Does anyone know what servers have EoJ's essentially disabled? On my server it seems like whatever you do, you only earn 1 EoJ per event.
Edit/Update: I was mistaken. I didn't realize that a certain number of points had to be earned to get a certain amount of eoj as a reward. I was under the assumption that if you place 1st, you would get the full reward. Since my original comment, I have managed to get enough points to get higher rewards. Still haven't gotten the full 6000 points though, as it seems hardly anyone is doing eoj events on my server and my script isn't efficient enough to get all the points myself.
Re: Energy of Justice easily earned
Posted: Fri Jan 24, 2014 9:46 am
by jester
Is it possible to change the channel means aadona location?
Re: Energy of Justice easily earned
Posted: Sun Jan 26, 2014 2:27 pm
by BlubBlab
kuripot wrote:ZZZZZ wrote:Code: Select all
<?xml version="1.0" encoding="utf-8"?><waypoints type="TRAVEL">
<onLoad>
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 EOJCrysalia()
waitForEventStart()
player:target_NPC(120273) -- Papp Hesof
RoMScript("DeleteQuestByID(425598)");
EOJCrysalia()
end
</onLoad>
<!-- # 1 --><waypoint x="-9407" z="-18349" y="945">
player:target(120273) -- Papp Hesof
EOJCrysalia()
</waypoint>
</waypoints>
That's what i used.
why it's not work to me.. just stamding on npc.. doing nothing
I can only say this will cause a stack overflow because EOJCrysalia() call EOJCrysalia() infinity times
Re: Energy of Justice easily earned
Posted: Tue Jan 28, 2014 10:41 pm
by L33t_Of_Lag
If i only have one char doing it, no stack overflow, if 1 or more chars do it, they both get stack overflow. Dont know why.
Re: Energy of Justice easily earned
Posted: Tue Jan 28, 2014 10:58 pm
by lisa
L33t_Of_Lag wrote:If i only have one char doing it, no stack overflow, if 1 or more chars do it, they both get stack overflow. Dont know why.
1 MM doing it probably just isn't enough to because of your PC performance.
Calling a function from within that same function isn't a good idea, you may aswell just do a repeat loop or something, either way adding a yrest in that loop/function will stop the stack overflow, even just 1 millisecond can be enough but I would go with maybe 500.
yrest(500)
Code: Select all
function EOJCrysalia()
waitForEventStart()
player:target_NPC(120273) -- Papp Hesof
RoMScript("DeleteQuestByID(425598)");
yrest(500)
EOJCrysalia()
end
Re: Energy of Justice easily earned
Posted: Tue Jan 28, 2014 11:57 pm
by L33t_Of_Lag
Good idea
Re: Energy of Justice easily earned
Posted: Wed Jan 29, 2014 1:08 am
by rock5
I don't think the yrest is the issue. The code inside the loop takes time to execute so the yrest wont make much difference. I'm not 100% sure but I think stack overflow error means the function called itself too many times. So, even though a function calling itself is bad practice, it should work as long as you stop before getting the stack overflow happens.
Just as a test I started the commandline and to see how many times MM will allow a function to call itself.
Code: Select all
Lua> c=0 function test() c=c+1 test() end test()
onLoad error: C:\Program Files (x86)\MICROMACRO\lib\lib.lua:491: stack overflow
Lua> print(c)
999960
So as long as you stop the bot before it does the event 999960 times, you shouldn't get a stack overflow.

Re: Energy of Justice easily earned
Posted: Wed Jan 29, 2014 1:38 am
by lisa
it depends greatly on what is inside the function.
example
Code: Select all
Command> c=0 function test() c=c+1 test() end test()
onLoad error: [string "c=0 function test() c=c+1 test() end test()"]:1: stack overflow
Command> print(c)
999954
Command> c=0 local z = 0 function test() local z = z+1 if stack then print("sure") end c=c+1 test() end test()
onLoad error: [string "c=0 local z = 0 function test() local z = z+1..."]:1: stack overflow
Command> print(c)
499976
Command> c=0 local z = 0 function test() z = z+1 if stack then print("sure") end
if z == 500 then print("lol") end c=c+1 test() end test()
lol
onLoad error: [string "c=0 local z = 0 function test() z = z+1 if st..."]:1: stack overflow
Command> print(c)
999953
Don't ask me why lol
Also see what happens when you add even a yrest(1) to your loop
Code: Select all
Command> st = os.time() c=0 function test() yrest(1) c=c+1 if c == 10000 then print(os.time() - st) return else test() end end test()
10
takes 10 seconds to do 10,000 loops with just 1 signle yrest(1) in there. without it you do 999960 in approx 1 second. So no stack overflow.
Also using a repeat loop won't get you a stack overflow no matter how big you make it, even without a yrest(1)
Code: Select all
Command> st = os.time() local c = 0 repeat c = c + 1 until c == 100000000 print(os.time() - st)
7
Re: Energy of Justice easily earned
Posted: Wed Jan 29, 2014 2:48 am
by rock5
lisa wrote:it depends greatly on what is inside the function.
I suspected as much but when I attempted to put extra stuff in the loop I ended up with the same number, so I didn't mention it. Obviously I didn't add the right stuff to affect the count.
Re: Energy of Justice easily earned
Posted: Wed Jan 29, 2014 6:48 pm
by BlubBlab
Yeah I changed the code also and tested it
First this function didn't work:
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
So I ignored it at the and I got only 4 EoJ's. I'm playing on the offical server maybe the shout it down or changed it?
or must I found the window were I can see how much time the round has to make it count?
Re: Energy of Justice easily earned
Posted: Wed Jan 29, 2014 8:40 pm
by lisa
It's been a while but i am pretty sure the in game functions don't work if the event info is bugged and you can't see the score on your screen.
Re: Energy of Justice easily earned
Posted: Wed Jan 29, 2014 11:41 pm
by rock5
Every now and then I think to my self "someone should write a foolproof general purpose userfunction to return the event status". Then every time someone asks questions about fixing their event code we could direct them to the userfunction. I never did it myself because I've never done the events so am unfamiliar with them but there are a lot of working code out there that should be able to be adapted to a userfunction.
Re: Energy of Justice easily earned
Posted: Thu Jan 30, 2014 12:34 am
by lisa
I did post some memory stuff a long time ago, but I think it was unstable for some users, can't remember now.
I did have the score and such straight from memory and it worked regardless of if the screen was bugged or not, I think, been a while since I did it.
Did some searching and people said the memory reads failed if event stuff was bugged on screen aswell, so yeah no joy there anyway.
Re: Energy of Justice easily earned
Posted: Thu Jan 30, 2014 2:23 am
by rock5
A reliable userfunction would have to rely on the alert messages.
You know, seeing as the igf remembers the messages all it would have to do is get the last start and end message and see which was the latest to know if it's still in the event or not. Of course it would have to deal with if there is no messages, such as when you just start the game or you just entered the region with the event.
Re: Energy of Justice easily earned
Posted: Thu Jan 30, 2014 10:21 am
by noobbotter
While this doesn't address the issue of finding out if the event is currently underway, I've found this to be very reliable in detecting the start and end of the event. This is basically a very stripped down version of what I use. Now for the actual code of accepting, turning in, and deleting the specific quests, I have all that in a macro so once the event starts, all I do is repeatedly press my macro key which is what this script will do.
Code: Select all
<?xml version="1.0" encoding="utf-8"?><waypoints>
<onload>
function waitevent() <!-- this will wait for event start message. Works every time regardless of display -->
local gomsg = getTEXT("SC_ZONE_PE_3TH_ST1START")
print("Wait for event start...\n") -- wait here
repeat
yrest(500)
until getLastWarning("|cffffff80"..gomsg.."|r", 30)
starttime = os.time()
print("Event has started...\n")
end
function EOJCrysalia()
keyboardPress( key.VK_I ) <!-- Presses the i key which is where my macro is for this event -->
yrest(100)
end
function main() <!-- at Papp Hesof -->
roundno = roundno + 1 <!-- increment round number - just for informational purposes-->
cprintf(cli.red,"\nRound %s.\n",roundno)
local eojs = getCurrency("eoj") <!-- reset number of eoj's in inventory for start of round -->
cprintf(cli.green,"Starting EOJs for round %s: %s.\n",roundno, eojs)
player:target_Object(120273) <!-- ensures my player targets Papp before round start -->
waitevent() <!-- this calls the function to wait for round start -->
repeat
EOJCrysalia()
<!-- To detect end of event, I look for a change in the number of eoj's that I have. -->
<!-- Even if I'm way low on the list of contributors, I'll still earn at least 1 eoj.-->
until getCurrency("eoj") > eojs
<!-- Next 4 lines is just to print a summary of the round. -->
local roundtime = (os.time()-starttime)/60
local neweoj = getCurrency("eoj")
local gained = neweoj-eojs
cprintf(cli.red,"EOJ Gained this round: %s.\t\tCurrent Energy of Justice: %s.\t\tRound took %0.1f minutes\n",gained, neweoj,roundtime)
end
starttime = os.time()
roundno = 0
</onload>
<!-- # 1 --><waypoint x="-9362" z="-18321" y="952" tag="eoj">
<!-- at Papp Hesof -->
main()
</waypoint>
<!-- # 2 --><waypoint x="-9362" z="-18321" y="952">
<!-- at this point you could have your character go somewhere else, go sit down, -->
<!-- or whatever for a certain period, until just prior to next round. -->
__WPL:setWaypointIndex(1)
</waypoint>
</waypoints>
I use the event message for start of round, which seems to work every time regardless of if the screen display is bugged or not.
To detect the end of the round, I look for a change in the number of Energy of Justice in my inventory. Works every time.
**EDIT: I had a typo on a line so I corrected it in the code above.
*** EDIT 2: To note, if the round takes less than 30 seconds (which happened to me tonight) you might want to reduce the number of seconds it looks back for the round start message. In the line
Code: Select all
until getLastWarning("|cffffff80"..gomsg.."|r", 30)
change the 30 to a lower number like 15 or so.
Re: Energy of Justice easily earned
Posted: Thu Jan 30, 2014 12:48 pm
by wiedzmin97
Code: Select all
Moving to waypoint #1, (-9362, -18321)
The game client did not crash.
6:47pm - [string "..."]:20: attempt to perform arithmetic on global 'roundno' (a
nil value)
i have this error when i starting bot wp ;/
Re: Energy of Justice easily earned
Posted: Thu Jan 30, 2014 12:59 pm
by noobbotter
My bad, I had a spelling error when I was removing and cleaning up my code.
On the last line of the <onload> section, this line:
should be