Thread: What is wong?

Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1 What is wong? 
    Registered Member Hexagon's Avatar
    Join Date
    May 2008
    Posts
    672
    Thanks given
    28
    Thanks received
    18
    Rep Power
    33
    well i made this so far: when you att you got a chance of rectiving coins(it's a minigame) and i put it in a ratio of 4:3 (in 4 att it happens 3 times) BUT it is only happening on a ratio of 4:1 (in 4 att only happen 1 time)

    here is my code:
    Code:
    public void cashh4x(){
    if(playerEquipment[playerCape] == 8022){
    if (misc.random(4) == 3){
    addItem(995, 1000000);
    }
    }
    }
    why it happens only in 4:1 and not 4:3?
    Reply With Quote  
     

  2. #2  
    Apple Computers
    Bridget7298's Avatar
    Join Date
    Aug 2007
    Age
    32
    Posts
    1,088
    Thanks given
    99
    Thanks received
    49
    Rep Power
    219
    Quote Originally Posted by sn4k3d View Post
    well i made this so far: when you att you got a chance of rectiving coins(it's a minigame) and i put it in a ratio of 4:3 (in 4 att it happens 3 times) BUT it is only happening on a ratio of 4:1 (in 4 att only happen 1 time)

    here is my code:
    Code:
    public void cashh4x(){
    if(playerEquipment[playerCape] == 8022){
    if (misc.random(4) == 3){
    addItem(995, 1000000);
    }
    }
    }
    why it happens only in 4:1 and not 4:3?
    put it at 4:6 and try that
    Reply With Quote  
     

  3. #3  
    Registered Member Hexagon's Avatar
    Join Date
    May 2008
    Posts
    672
    Thanks given
    28
    Thanks received
    18
    Rep Power
    33
    like this?

    if (misc.random(4) == 6){

    EDIT: than it don't happen at all
    Reply With Quote  
     

  4. #4  
    Banned

    Join Date
    Jul 2008
    Posts
    1,043
    Thanks given
    209
    Thanks received
    46
    Rep Power
    0
    I don't know why but ill try:

    Synchronization problem?
    Reply With Quote  
     

  5. #5  
    Registered Member Hexagon's Avatar
    Join Date
    May 2008
    Posts
    672
    Thanks given
    28
    Thanks received
    18
    Rep Power
    33
    Quote Originally Posted by Witch King View Post
    I don't know why but ill try:

    Synchronization problem?
    why it would be? i just did this:

    obs that's ava's effect just hided for leechers:
    "jagex states than we keep 80% of the arrows we shot"
    so:
    80% = in 100 shots you keep 80 arrows
    simplified

    100/10 80/10

    in 10 shots we keep 8 arrows
    10/2 8/2
    in 5 shots we keep 4 arrows

    (OOPS figured out i put the wrong number but i think the prob will b the same)
    Reply With Quote  
     

  6. #6  
    Apple Computers
    Bridget7298's Avatar
    Join Date
    Aug 2007
    Age
    32
    Posts
    1,088
    Thanks given
    99
    Thanks received
    49
    Rep Power
    219
    Go into item2.java and add something like this:
    Code:
    public static int pkDrop[] = {995};
        public static int randompkDrop() {
    		return pkDrop(int)(Math.random()*pkDrop.length)];
    	}
    
    }
    Now find this:
    Code:
    public void cashh4x(){
    if(playerEquipment[playerCape] == 8022){
    if (misc.random(6) == 4){
    addItem(995, 1000000);
    }
    }
    }
    Change that too:
    Code:
    public void cashh4x(){
    if(playerEquipment[playerCape] == 8022){
    if(misc.random(2) == 7) {
    addItem(item2.randompkDrop, 1000000);
    }
    }
    }
    Try that
    Reply With Quote  
     

  7. #7  
    Registered Member Hexagon's Avatar
    Join Date
    May 2008
    Posts
    672
    Thanks given
    28
    Thanks received
    18
    Rep Power
    33
    that would aways add the cash =] anyways i made a better code and worked out thanks all for helping
    Reply With Quote  
     

  8. #8  
    Seecon
    Guest
    public void cashh4x(){
    if(playerEquipment[playerCape] == 8022){
    if (misc.random(4) == 3){
    addItem(995, 1000000);
    }
    }
    }

    misc.random returns 1 number not like.. the first 3 and also it includes 0 so you're looking at a 1 in 5 chance with that code...
    Reply With Quote  
     

  9. #9  
    Registered Member Hexagon's Avatar
    Join Date
    May 2008
    Posts
    672
    Thanks given
    28
    Thanks received
    18
    Rep Power
    33
    Quote Originally Posted by Seecon View Post
    public void cashh4x(){
    if(playerEquipment[playerCape] == 8022){
    if (misc.random(4) == 3){
    addItem(995, 1000000);
    }
    }
    }

    misc.random returns 1 number not like.. the first 3 and also it includes 0 so you're looking at a 1 in 5 chance with that code...
    already fixed myself
    Reply With Quote  
     

  10. #10  
    Registered Member Poindexter's Avatar
    Join Date
    Dec 2007
    Age
    32
    Posts
    195
    Thanks given
    0
    Thanks received
    0
    Rep Power
    7
    Code:
    public void cashh4x(){
    if(playerEquipment[playerCape] == 8022){
    if (misc.random(4) == 1 || misc.random(4) == 2 || misc.random(4) == 3){
    addItem(995, 1000000);
    }
    }
    }
    Simple. misc.random returns 1 number, so when you put 4 it returns EITHER a 1,2,3,or a 4. You have to check for 3 of the numbers not just one.

    ~I lyfe I.
    When in doubt, push reset.



    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
  •