Thread: [REP-code] Letting Java have a choice, either do this or this or this ...

Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1 [REP-code] Letting Java have a choice, either do this or this or this ... 
    Author of the first public OSRSPS

    Shadowy's Avatar
    Join Date
    Sep 2009
    Age
    25
    Posts
    1,501
    Thanks given
    484
    Thanks received
    239
    Discord
    View profile
    Rep Power
    307
    Hi if there a code for letting the server have an opinion? [please code the following for rep] I want to have random teleporting into bounty hunter. So i need a code like

    (in action buttons) the normal staff, buttonId=573489572394
    Show interface bh targ thingy
    send strring bla bla for targ..
    but when u go in
    p.teleTo x:2345245 y:245254
    OR YOU CAN TELE TO
    p.teleTo x3785622 y:24578248357

    ect... so i can set the co ords to the enterances and exits in BH
    Reply With Quote  
     

  2. #2  
    Renown Programmer
    Method's Avatar
    Join Date
    Feb 2009
    Posts
    1,455
    Thanks given
    0
    Thanks received
    843
    Rep Power
    3019
    Code:
    if (Math.random() < 0.5) {
        teleportHere();
    } else {
        teleportThere();
    }
    :-)
    Reply With Quote  
     

  3. #3  
    Author of the first public OSRSPS

    Shadowy's Avatar
    Join Date
    Sep 2009
    Age
    25
    Posts
    1,501
    Thanks given
    484
    Thanks received
    239
    Discord
    View profile
    Rep Power
    307
    Gonna try it. If it works ill REP, i've been looking for this for a long time!!!

    What about

    case 1234:
    if (p.bountyhunter) {
    &nbsp.teleTo(1234, 2953);
    } else {
    &nbsp.teleTo(1253, 2952);
    }
    break;

    Dude errors on yours:

    net/com/codeusa/Engine.java
    .\net\com\codeusa\net\packethandler\ActionButtons. java:770: 'else' without 'if'
    } else {
    ^
    .\net\com\codeusa\net\packethandler\ActionButtons. java:772: 'else' without 'if'
    } else {
    ^
    .\net\com\codeusa\net\packethandler\ActionButtons. java:774: 'else' without 'if'
    } else {
    ^
    .\net\com\codeusa\net\packethandler\ActionButtons. java:776: 'else' without 'if'
    } else {
    ^
    .\net\com\codeusa\net\packethandler\ActionButtons. java:778: 'else' without 'if'
    } else {
    ^
    .\net\com\codeusa\net\packethandler\ActionButtons. java:780: 'else' without 'if'
    } else {
    ^
    .\net\com\codeusa\net\packethandler\ActionButtons. java:782: 'else' without 'if'
    } else {
    ^
    .\net\com\codeusa\net\packethandler\ActionButtons. java:784: 'else' without 'if'
    } else {
    ^
    .\net\com\codeusa\net\packethandler\ActionButtons. java:786: 'else' without 'if'
    } else {
    ^
    .\net\com\codeusa\net\packethandler\ActionButtons. java:788: 'else' without 'if'
    } else {
    ^
    .\net\com\codeusa\net\packethandler\ActionButtons. java:790: 'else' without 'if'
    } else {
    ^
    .\net\com\codeusa\net\packethandler\ActionButtons. java:792: 'else' without 'if'
    } else {
    ^
    .\net\com\codeusa\net\packethandler\ActionButtons. java:794: 'else' without 'if'
    } else {
    ^
    .\net\com\codeusa\net\packethandler\ActionButtons. java:796: 'else' without 'if'
    } else {
    ^
    .\net\com\codeusa\net\packethandler\ActionButtons. java:798: 'else' without 'if'
    } else {
    ^
    .\net\com\codeusa\net\packethandler\ActionButtons. java:800: 'else' without 'if'
    } else {
    ^
    .\net\com\codeusa\net\packethandler\ActionButtons. java:802: 'else' without 'if'
    } else {
    ^
    .\net\com\codeusa\net\packethandler\ActionButtons. java:804: 'else' without 'if'
    } else {
    ^

    I added if to make it else if but then the errors doubled.

    I set it out like this:

    if (Math.random() < 0.5) {
    p.teleportTo(3146, 3681, 0, 0, 0, 8939, 8941, 1576, 0, 1577, 0); //normal entering place
    } else {
    p.teleportTo(3138, 3669, 0, 0, 0, 8939, 8941, 1576, 0, 1577, 0);
    } else {
    p.teleportTo(3124, 3665, 0, 0, 0, 8939, 8941, 1576, 0, 1577, 0);
    }
    Reply With Quote  
     

  4. #4  
    Respected Donater

    Mario's Avatar
    Join Date
    Sep 2007
    Age
    27
    Posts
    1,255
    Thanks given
    32
    Thanks received
    15
    Rep Power
    778
    stop double posting and shit and
    Code:
     if (Math.random() < 0.5) {
        teleportHere();
    } else {
        teleportThere();
    }
    would go in Process()
    [rsimg]1042[/rsimg][rsimg]1044[/rsimg][rsimg]1046[/rsimg][rsimg]1038[/rsimg][rsimg]1048[/rsimg][rsimg]1040[/rsimg]Mario[rsimg]1040[/rsimg][rsimg]1048[/rsimg][rsimg]1038[/rsimg][rsimg]1046[/rsimg][rsimg]1044[/rsimg][rsimg]1042[/rsimg]

    Reply With Quote  
     

  5. #5  
    Author of the first public OSRSPS

    Shadowy's Avatar
    Join Date
    Sep 2009
    Age
    25
    Posts
    1,501
    Thanks given
    484
    Thanks received
    239
    Discord
    View profile
    Rep Power
    307
    Quote Originally Posted by `Brad View Post
    stop double posting and shit and
    Code:
     if (Math.random() < 0.5) {
        teleportHere();
    } else {
        teleportThere();
    }
    would go in Process()
    what u mean soz new to coding.
    Reply With Quote  
     

  6. #6  
    JohnK
    Guest
    Bro, Just else statements lol

    Code:
    if (Misc.random(10) == 1) {
    TeleportMethodHere();
    } else if (Misc.random(10) == 2) {
    TeleMethod2Here();
    } else if (Misc.random(10) == 3) {
    TeleMethod3Here();
    }
    So on and so on.
    Reply With Quote  
     

  7. #7  
    Community Veteran



    Join Date
    Jan 2008
    Posts
    3,448
    Thanks given
    46
    Thanks received
    973
    Rep Power
    4723
    u sud read some basic java tuts

    Reply With Quote  
     

  8. #8  
    Author of the first public OSRSPS

    Shadowy's Avatar
    Join Date
    Sep 2009
    Age
    25
    Posts
    1,501
    Thanks given
    484
    Thanks received
    239
    Discord
    View profile
    Rep Power
    307
    @Richard thanks for the advise, got any simple ones you know of?
    @JohnHax` im gonna try it now if it work rep, and thanks look below please

    EDIT: what does (Misc.random(10) == 2 do/mean?

    EDIT2: it worked tyvm : ) first z525 yet again, following, pvp bank timers, no random bh entering : )
    Reply With Quote  
     

  9. #9  
    Author of the first public OSRSPS

    Shadowy's Avatar
    Join Date
    Sep 2009
    Age
    25
    Posts
    1,501
    Thanks given
    484
    Thanks received
    239
    Discord
    View profile
    Rep Power
    307
    What does (Misc.random(10) == 2 do/mean?

    I posted again so you would look, because edits dont make the post have new media?
    Reply With Quote  
     

  10. #10  
    SERGEANT OF THE MASTER SERGEANTS MOST IMPORTANT PERSON OF EXTREME SERGEANTS TO THE MAX!

    cube's Avatar
    Join Date
    Jun 2007
    Posts
    8,881
    Thanks given
    1,854
    Thanks received
    4,741
    Rep Power
    5000
    Quote Originally Posted by Shadowy View Post
    What does (Misc.random(10) == 2 do/mean?

    I posted again so you would look, because edits dont make the post have new media?
    It draws a number between 0 and 10. If the number it drew is 2, it executes that code.



    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •