Jump to content

redeye

Members
  • Posts

    115
  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by redeye

  1. 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);
    g
    gr.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
  2. 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?

  3. 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.

  4. 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?

  5. 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 smile.png   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?

  6.  

     

    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

  7. 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);
            
    }

     

     

     

     

     

     
  8. 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?

  9. 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

  10. 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 smile.png

     

    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... :(

×
×
  • Create New...