Thread: Fix for Clicking Buttons

Results 1 to 10 of 10
  1. #1 Fix for Clicking Buttons 
    Registered Member

    Join Date
    Nov 2014
    Posts
    306
    Thanks given
    33
    Thanks received
    11
    Discord
    View profile
    Rep Power
    122
    What is a better way for Clicking Buttons? My "else if statements appear to just run to the next one" I've tried using breaks, else if's, return ect.. resetting dialogue to 0 and teleAction to 0 still nothing!

    Edit: I got this figured out, someone can close this thread.

    Code:
    } else if (c.teleAction == 4) {
    				// Fala
    				c.getPA().resetAutocast();
    				c.getPA().spellTeleport(3321, 3895, 0);
    				c.teleAction = 0;
    		
    			} else if (c.teleAction == 5) {
    				c.getPA().spellTeleport(2724, 3484, 0);
    				c.sendMessage("For magic logs, try north of the duel arena.");
    				c.teleAction = 0;
    			}
    Reply With Quote  
     

  2. #2  
    Glory-PS Owner

    Benneh's Avatar
    Join Date
    Nov 2015
    Posts
    194
    Thanks given
    127
    Thanks received
    93
    Discord
    View profile
    Rep Power
    464
    Why does it start with Else if?
    Quote Originally Posted by Corey View Post
    Vouch for Benneh

    Worked with him for a month. He's professional and always on time with posts, always interested in how the server is doing and how he can can improve and help in any way.
    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    Registered Member

    Join Date
    Nov 2014
    Posts
    306
    Thanks given
    33
    Thanks received
    11
    Discord
    View profile
    Rep Power
    122
    Quote Originally Posted by Benneh View Post
    Why does it start with Else if?
    The above starts with "if" this is just an example.
    Reply With Quote  
     

  5. Thankful user:


  6. #4  
    Equinox ツ

    Join Date
    Jun 2021
    Posts
    12
    Thanks given
    3
    Thanks received
    8
    Discord
    View profile
    Rep Power
    32
    Not 100% sure if this would work
    } else if (c.teleAction == 4) {
    // Fala
    c.getPA().resetAutocast();
    c.getPA().spellTeleport(3321, 3895, 0);
    c.teleAction = 0;

    return;
    } else {
    if (c.teleAction == 5) {
    c.getPA().spellTeleport(2724, 3484, 0);
    c.sendMessage("For magic logs, try north of the duel arena.");
    c.teleAction = 0;
    }}
    Reply With Quote  
     

  7. Thankful user:


  8. #5  
    Banned

    Join Date
    May 2016
    Age
    52
    Posts
    1,141
    Thanks given
    565
    Thanks received
    600
    Discord
    View profile
    Rep Power
    0
    A switch and case ids? Not too sure what you're asking for.
    Reply With Quote  
     

  9. Thankful user:


  10. #6  
    Registered Member

    Join Date
    Nov 2014
    Posts
    306
    Thanks given
    33
    Thanks received
    11
    Discord
    View profile
    Rep Power
    122
    Quote Originally Posted by Wells Fargo View Post
    A switch and case ids? Not too sure what you're asking for.
    basically lets say if i click a teleport then hit next, then i click away and dialogue is removed, ill go over to my slayer master to talk with him to teleport to a dungeon or something but the second i click next it'll show the other teleport i was first on.

    Quote Originally Posted by Milo View Post
    Not 100% sure if this would work
    No help, but thank you. I tried it out
    Reply With Quote  
     

  11. #7  
    Registered Member
    King Zeus's Avatar
    Join Date
    Jan 2018
    Posts
    201
    Thanks given
    34
    Thanks received
    77
    Rep Power
    145
    Message me on discord and I will try and help you out.
    ---------------------------------------------
    My Contributions:
    [317]
    Run Regeneration
    [OSRS]
    Prifddinas Agility Course
    Priffdinnas NPC Spawns
    ---------------------------------------------
    Reply With Quote  
     

  12. Thankful user:


  13. #8  
    Registered Member

    Join Date
    Nov 2014
    Posts
    306
    Thanks given
    33
    Thanks received
    11
    Discord
    View profile
    Rep Power
    122
    Quote Originally Posted by King Zeus View Post
    Message me on discord and I will try and help you out.
    What is your discord?
    Reply With Quote  
     

  14. #9  
    Registered Member
    Join Date
    Mar 2018
    Posts
    16
    Thanks given
    0
    Thanks received
    1
    Rep Power
    27
    I see the problem based on the code, pm me on discord. I'll fix it for a small price. Moneynewxbl
    Reply With Quote  
     

  15. #10  
    Registered Member
    Join Date
    May 2021
    Posts
    25
    Thanks given
    4
    Thanks received
    2
    Rep Power
    11
    Wait did we jumped back to 2013 this code looks like it

    Quote Originally Posted by scoping king View Post
    What is a better way for Clicking Buttons? My "else if statements appear to just run to the next one" I've tried using breaks, else if's, return ect.. resetting dialogue to 0 and teleAction to 0 still nothing!

    Edit: I got this figured out, someone can close this thread.

    Code:
    } else if (c.teleAction == 4) {
    				// Fala
    				c.getPA().resetAutocast();
    				c.getPA().spellTeleport(3321, 3895, 0);
    				c.teleAction = 0;
    		
    			} else if (c.teleAction == 5) {
    				c.getPA().spellTeleport(2724, 3484, 0);
    				c.sendMessage("For magic logs, try north of the duel arena.");
    				c.teleAction = 0;
    			}
    Do not use else if for your buttons its not needed as you alredy check for teleAction == id

    Code:
    if (4 == c.teleAction) {
    				c.getPA().spellTeleport(52452, 7272, 0);
    				c.sendMessage("Example.");
    				c.teleAction = 0;
    			}
    if (5 == c.teleAction) {
    				c.getPA().spellTeleport(2724, 3484, 0);
    				c.sendMessage("For magic logs, try north of the duel arena.");
    				c.teleAction = 0;
    			}
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

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


User Tag List

Similar Threads

  1. 602 Skilltab Fix For Logout Button
    By I'm A Jerk in forum Snippets
    Replies: 7
    Last Post: 02-22-2012, 01:32 PM
  2. Replies: 1
    Last Post: 11-22-2011, 06:09 AM
  3. Runelimited - Cheap fix for the settings button
    By thim slug in forum Snippets
    Replies: 11
    Last Post: 06-19-2011, 05:26 PM
  4. [Devo 2.7] Small fix for clicking objects
    By Tobias in forum Snippets
    Replies: 0
    Last Post: 06-15-2010, 02:52 PM
  5. Fix for all right clicking. [Refactored]
    By 35518 in forum Tutorials
    Replies: 4
    Last Post: 05-17-2009, 06:10 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •