The Hero of Time Posted March 23, 2016 Posted March 23, 2016 (edited) it will stop the script with comment "for your accounts safety" well, if you hop a lot, sometimes you can log out, and it will log back in. if you log out again in an hour or so it will just stop the script with that message. so my script stopped after like 4 hours because of that, the other time it stopped after 6hrs, so its just random. if osbot just logs back in ignoring that "for your accounts safety" then i could run my script for much longer. i get why its implemented, but its not usefull for hopping scripts. can you disable it? Edited March 23, 2016 by The Hero of Time
Token Posted March 23, 2016 Posted March 23, 2016 RandomExecutor.unregisterHook(RandomEvent.AUTO_LOGIN);
The Hero of Time Posted March 23, 2016 Author Posted March 23, 2016 RandomExecutor.unregisterHook(RandomEvent.AUTO_LOGIN); Isolate showed that, but that disables the auto-login right? isnt the stopping script because too many tries part of something else
Token Posted March 23, 2016 Posted March 23, 2016 Isolate showed that, but that disables the auto-login right? isnt the stopping script because too many tries part of something else Yes it disables the autologin and I believe the tries are internal to the login hook. Re-registering the hook from a parallel thread might do the trick.
The Hero of Time Posted March 23, 2016 Author Posted March 23, 2016 Yes it disables the autologin and I believe the tries are internal to the login hook. Re-registering the hook from a parallel thread might do the trick. so by disabling/enabling it it resest the tries? that'll be great
Token Posted March 23, 2016 Posted March 23, 2016 so by disabling/enabling it it resest the tries? that'll be great Yes it might work, I'm not sure as I've been advising people to do this for months on the forums, haven't actually had to try it myself. No one told me it doesn't work so I guess no news is good news. Just wondering though, why would you try to login and fail on purpose?
The Hero of Time Posted March 23, 2016 Author Posted March 23, 2016 Yes it might work, I'm not sure as I've been advising people to do this for months on the forums, haven't actually had to try it myself. No one told me it doesn't work so I guess no news is good news. Just wondering though, why would you try to login and fail on purpose? on purpose? nono :P the script hops to another world to continue picking the item, and it will wait about 13-14 seconds before hopping again so you dont get kicked out, but somehow it will still kick you out sometimes, but thats rarely, so if the bot doesnt stop but just logs back in that would fix the problem
Token Posted March 23, 2016 Posted March 23, 2016 on purpose? nono the script hops to another world to continue picking the item, and it will wait about 13-14 seconds before hopping again so you dont get kicked out, but somehow it will still kick you out sometimes, but thats rarely, so if the bot doesnt stop but just logs back in that would fix the problem Well, good luck with that but that I don't think the server kicking you out is a randomly defined behaviour so you may be able to study the case and find a workaround for that. But if you really want to dig into this when the API is up again, you could take a look at the LoginResponseCodeListener as Script implements that, so you have the onResponseCode(int) method in there which might help you define a behaviour when you get the response "too many login attempts" or "no reply from the login server".
The Hero of Time Posted March 23, 2016 Author Posted March 23, 2016 Well, good luck with that but that I don't think the server kicking you out is a randomly defined behaviour so you may be able to study the case and find a workaround for that. But if you really want to dig into this when the API is up again, you could take a look at the LoginResponseCodeListener as Script implements that, so you have the onResponseCode(int) method in there which might help you define a behaviour when you get the response "too many login attempts" or "no reply from the login server". it doesn't try to login though, so you never get the message "too many login attempts" or "no reply from the login server". osbot detects this without trying, same with getting banned, you log out and the script stops and you get a message your account has been disabled in the osbot logger, without it trying to login and see the ban message
Khaleesi Posted March 23, 2016 Posted March 23, 2016 I don't think the unregisterHook works ... When I tried to use it it still logged in my acc automatically =)
The Hero of Time Posted March 23, 2016 Author Posted March 23, 2016 I don't think the unregisterHook works ... When I tried to use it it still logged in my acc automatically =) any idea how to stop osbot from stopping the script when trying to log in too many times then?
Flamezzz Posted March 23, 2016 Posted March 23, 2016 There's no way to modify Autologin in SDN scripts, with some hacks it is possible for private scripts tho. Preventing it from stopping the script can be difficult but what about restarting the script when this happens? If onExit() is called you can spawn a thread and restart your script.
The Hero of Time Posted March 23, 2016 Author Posted March 23, 2016 (edited) There's no way to modify Autologin in SDN scripts, with some hacks it is possible for private scripts tho. Preventing it from stopping the script can be difficult but what about restarting the script when this happens? If onExit() is called you can spawn a thread and restart your script. so if the user stops the script it will restart again until user closes osbot? Edited March 23, 2016 by The Hero of Time
Flamezzz Posted March 23, 2016 Posted March 23, 2016 (edited) so if the user stops the script it will restart again until user closes osbot? Yes if you implement this in the most straightforward way, but you can ofc prevent this by for example implementing onRespnseCode() like AutoLogin does. Edited March 23, 2016 by Flamezzz
Botre Posted March 23, 2016 Posted March 23, 2016 You can prevent the AUTO_LOGIN Random event from activating via response codes. You may have to play around with shouldActivate & onResponseCode. I 've done this before so it's deffo possible, but not sure if this kinda stuff is allowed for SDN scripts. getBot().getRandomExecutor().registerHook(new RandomBehaviourHook(RandomEvent.AUTO_LOGIN) { private RandomSolver solver = getBot().getRandomExecutor().forEvent(RandomEvent.AUTO_LOGIN); @Override public void onResponseCode(int c) throws InterruptedException { //INSERT WORK_AROUND HERE } @Override public void onStart() throws InterruptedException { super.onStart(); solver.onStart(); } @Override public boolean shouldActivate() { return solver.shouldActivate(); //Play around with this } @Override public int onLoop() throws InterruptedException { super.onLoop(); return solver.onLoop(); } @Override public void onExit() throws InterruptedException { super.onExit(); solver.onExit(); } }); }