-
Posts
115 -
Joined
-
Last visited
-
Feedback
0%
Posts posted by redeye
-
-
Hey all,
I was wondering how you can do the events. In OsBot1 it was automatic but now its not. How to do this now?
Thanks in regard,
Redeye
-
Ah lucky me. I've puttet it at 15 haha, thanks everyone!
-
i see.. how many tiles are visible from middle to say east on the minimap?
-
Thanks swizzbeat, solved it with:
Position p = new Position(x1WS,y1WS,0);mouse.click(new MiniMapTileDestination(bot, p)); -
In the sence of not a half but one or two tiles away from the character.
The gege is where it should be going, and the walk is that its going to walk there
-
Hey,
Anyone had the problem that map.walk(area) which is nearby (1/2 tiles away) doesnt walk to there?
Even localWalker.walk(position) doesnt work
Hope someone can help me, thanks in regard.
Redeye
-
Hey,
I just got back from osbot1 and now its osbot2 and much has changed.
Is there a summary of the changes or something like that?
Thanks in regard,
Redeye
-
Hey,
Thank you very much all for the feedback! Indeed a lot has haha, but will get there Some good API's i saw tho!
-
Hey,
I've just come back to make bot scripts again and i was wondering why my paint is not working anymore.. I haven't seen in other scripts the code is any different from mine:
public void onPaint(Graphics g){Graphics2D gr = (Graphics2D)g;gr.setColor(Color.RED);gr.setFont(new Font("Arial", Font.PLAIN,20));gr.drawString("Ores Mined: " + ore, 215, 50);ggr.drawString("Time running: " + uuren(runTime3.getElapsed()) + ":" + minuuten(runTime2.getElapsed()) + ":" + secoonden(runTime.getElapsed()) + ".", 25, 190);gr.drawString("Status: " + status, 25, 210);}Probs im overlooking something... Hope you can help me.Thanks in regard,Redeye -
you should check whether your onLoop actually returns after the walking
It did return after the walking but than at the end of the function it didnt go back to onLoop.
log("its rude to interrupt"); // <---- VERY IMPORTANT ----> \\
You are supposed to throw the execption.I know have:
public int onLoop() throw interruptedException
Is that good?
-
nullpointerexeception wont stop it from working anyways, it just spams errors in the client.
You still need to catch the nullpointer OR check for a null pointer != null
Yeah figured as much. Will do everywhere a != null check.
onLoop is called in a thread, so the thread closed somehow. And i found on the internet that a thread can only close when
"
- The exit method of class Runtime has been called and the security manager has permitted the exit operation to take place.
- All threads that are not daemon threads have died, either by returning from the call to the run method or by throwing an exception that propagates beyond the run method.
"
And i think the last one, that a daemon thread throw an exception that propagates beyond the run method, what do you guys think?
This "closing thread that calls onLoop" thingie happened after a simple walk().
Hmm i should make my own thread and call onLoop haha will that solve it? Probably not haha.
-
i changed it to interruptedException and now i see that i have alot of nulpointerexception, which i didnt have before. So was that the problem? If i fix these nulpointerexception my onloop wont suddenly stop working?
-
I'll help you out. Rather then doing a try and catch, just throw an InterruptedException. Also, where it says switch, wtf is (state). You should create a new method called getState().
Example:
Switch(getState()){
}
Now, Create an enum of states.
Example:
Public nameOfEnum enum {
RUN, SLEEP, LEARN
};
Within the getState() method you would create condition and make it return the states.
For example if you have a state called "RUN". Your onLoop would look like
Switch(getState()){
case RUN: (the name of the state from your enum)
return runFrom(); (name of the new method you want it to perform).
Or
case SLEEP:
(Put your code with in here).
Break;
}
Let me know if you still need more help
aaah i get it now haha thx! Is it persee needed to say return (runfrom()) cant it just be runFrom() without the return? and than break; or is it the same haha:
case RUN:
return runFrom();
====
case RUN:
runFrom();
break;
will change to interruptedException! I think there is the problem that it doesnt call the onLoop() anymore. I had a log in my onloop when the bug occured it never spammed what was in that log. And the paint was still running. So yeah i think its the try catch problem i hope. Will change it today and run it overnight edit:-- still got stuck
i now have:
State state = State.WHEREAMI;
enum State
{
FIGHTMID, FIGHTWEST, FIGHTEAST, BANKING, EXCHANGE_POINTS, GETONBOAT, INSIDEBOAT, WHEREAMI
,FIGHTSOUTHWEST,FIGHTSOUTHEAST, COORDINATES, JUSTONISLAND, DOOREAST, DOORWEST, DOORSOUTHEAST,
DOORSOUTHWEST
} (do you need to ; this?)
is getState() already a function or do you need to make it yourself? If you need to make it yourself how would it look like?
-
Back to basics for you.
give hints instead of making a fool of me.
You should really do so. You'll soon find out where your mistakes are in 2 secs.
The only thing i forgot are breaks, dont know what else... hints pl0x
-
Back to basics for you.
give hints instead of making a fool of me.
-
Using Client Version: 1.62
Issue: Don't know exact how, but most of the time it was after the bot tried to walk to somewhere it did came out of the function, but never returned to the onLoop().Example:
public int onLoop()
{
try
{
switch(state)
{
case FIGHTMID:
stateCount = 1;
return fightmid();
case GETONBOAT:
stateCount = 2;
return getonboat();
case INSIDEBOAT:
stateCount = 3;
return insideboat();
case WHEREAMI:
stateCount = 4;
return whereami();
case DOORSOUTHWEST:
stateCount = 5;
return doorsouthwest();
case FIGHTSOUTHWEST:
stateCount = 6;
return fightsouthwest();
case DOORSOUTHEAST:
stateCount = 7;
return doorsoutheast();
case FIGHTSOUTHEAST:
stateCount = 8;
return fightsoutheast();
case DOOREAST:
stateCount = 9;
return dooreast();
case FIGHTEAST:
stateCount = 10;
return fighteast();
case DOORWEST:
stateCount = 11;
return doorwest();
case FIGHTWEST:
stateCount = 12;
return fightwest();
case COORDINATES:
stateCount = 13;
return coordinates();
case JUSTONISLAND:
stateCount = 14;
return justonisland();
case EXCHANGE_POINTS:
stateCount = 15;
return exchange_points();
case BANKING:
stateCount = 16;
return banking();
default:
log("fout in de onLoop");
}
}
catch (InterruptedException e)
{
log("its rude to interrupt"); // <---- VERY IMPORTANT ----> \\
} catch (Exception e)
{
e.printStackTrace();
stuckCount++;
if(OUTSIDE_BOAT_AREA.contains(client.getMyPlayer()))
{
state = State.GETONBOAT;
}
return random(50,150);
}
return random(100);
} -
Hey,
I've made a pest control bot, but once everywhile when it is going to somewhere in the walk() function and the game suddenly ends and it is still in that walk function it freezes the whole code. It seems it can't get out of it like it's in a do while loop untill it reaches the given area/spot. (is there a way to see the code of these API's?:P ).
P.S. it is not giving me an exception or something like that. It never gets out of the walk() function it seems, cause i've placed EVERYWHERE logs and none were written on the screen.
Any suggestions on how to fix this? Maybe using interrupts?
-
niceee, thxxx
-
I often have full hp and the bot still thinks it has low hp... How do you guys check current hp?
-
Hey,
when it enters the randomevent molly it stops after going through the door. Probably cause he thinks he is seeing the machine so not moving camera and cant get to it because it's not on the screen... Maybe add a walk in there just to be safe?
I hope this helped.
Greets,
Redeye
-
haha posted anwser on other topic hihi
-
hey, i need asap. thumbnail 180 * 180 and paint idk what normal is? It just need to say somewhere like Redeye's pest control or something original haha for the rest use your imagine
I will give you pest control bot for free if you want. (human like pest controller, not a fail one that stands mid or can't hop worlds etc.. HUMAN LIKE)
greets,
Redeye
edit: still waiting...
-
hey! I really need as soon as possible a cool paint for my Pest control bot. if you could make it cool and somewhere say Redeye's Pest Control that would be awesome
-
probs. client problem with modeling stuff
So is it my problem or are you guys gonna fix it?:p
How to activate random events
in Scripting Help
Posted
Aaah ok, so there is no easy way of doing the randoms?