Signup Now
Page 1 of 2 12 LastLast
Results 1 to 10 of 20
  1. #1
    Free User Forgee's Avatar
    Join Date
    Dec 2013
    Location
    Sweden
    Posts
    5
    Reputation
    16
    Rep Power
    0

    Waypoint Buttons

    I'm trying to learn to do HUD's so I made this simple one to add waypoints. I looked at how Sirmate did to make his HUD movable, so credits for that goes to Sirmate.

    To move it just hold down the right mouse button and drag it.
    Simply click a button to add selected waypoint at you current position. North/South/East/West adds a 'stand' waypoint in respective direction.
    I hope someone finds a use for it.

    Attached Files Attached Files
    Last edited by Borges; 08-22-2015 at 06:04 PM. Reason: Upload images to imgur.com

  2. #2
    Banned
    Join Date
    Dec 2013
    Location
    Poland
    Posts
    242
    Reputation
    14
    Rep Power
    0
    Testing now!
    You can copy aswell it from here, instead of downloading.

    PHP Code:
    -- Waypoint Buttons by Forgee
    -- Inspired by Sirmate
    init start
        
    -- Buttons
        local Buttons 
    = {
            {
    text "Walk"id = -1action = function() addwaypoint('walk'$posx$posy$poszend},
            {
    text "Node"id = -1action = function() addwaypoint('node'$posx$posy$poszend},
            {
    text "Stand"id = -1action = function() addwaypoint('stand'$posx$posy$poszend},
            {
    text "Shovel"id = -1action = function() addwaypoint('shovel'$posx$posy$poszend},
            {
    text "Rope"id = -1action = function() addwaypoint('rope'$posx$posy$poszend},
            {
    text "Machete"id = -1action = function() addwaypoint('machete'$posx$posy$poszend},
            {
    text "Ladder"id = -1action = function() addwaypoint('ladder'$posx$posy$poszend},
            {
    text "Use"id = -1action = function() addwaypoint('use'$posx$posy$poszend},
            {
    text "Action"id = -1action = function() addwaypoint('action'$posx$posy$poszend},
            {
    text "Lure"id = -1action = function() addwaypoint('lure'$posx$posy$poszend},
            {
    text "North"id = -1action = function() addwaypoint('stand'$posx$posy-1$poszend},
            {
    text "South"id = -1action = function() addwaypoint('stand'$posx$posy+1$poszend},
            {
    text "East"id = -1action = function() addwaypoint('stand'$posx+1$posy$poszend},
            {
    text "West"id = -1action = function() addwaypoint('stand'$posx-1$posy$poszend},
        }
        
    local lastPressed = {id = -1time $timems}
        
    local rectHeightrectWidth 20 + (#Buttons * 25), 100
        
    setposition($clientwin.left$clientwin.top)
        
    setfontsize(9)

        
    filterinput(falsetruefalsefalse)
        
    local MovingTempMoved false, {00}, {00}
     
        function 
    inputevents(e)
            if (
    e.type == IEVENT_LMOUSEDOWNthen
                
    for _button in ipairs(Buttons) do
                    if (
    e.elementid == button.idthen
                        lastPressed 
    = {id button.idtime $timems}
                        
    button.action()
                    
    end
                end
            end
            
    if (e.type == IEVENT_RMOUSEDOWNthen
                Moving
    Temp true, {$cursor.Moved[1], $cursor.Moved[2]}
            
    end
     
            
    if (e.type == IEVENT_RMOUSEUPthen
                Moving 
    false
                
    if math.abs(Moved[1]) <= 15 then
                    Moved
    [1] = 0
                end
                
    if math.abs(Moved[2]) <= 15 then
                    Moved
    [2] = 0
                
    elseif math.abs(($worldwin.bottom-20) - Moved[2]) <= 15 then
                    Moved
    [2] = $worldwin.bottom-20
                end
            end
        end
    init end

    if (Movingthen
        auto
    (10)
        
    Moved = {$cursor.Temp[1], $cursor.Temp[2]}
    end
     
    setposition
    ($clientwin.left-Moved[1], $clientwin.top Moved[2])

    setfillstyle('color'color(55555550))
    drawrect(00rectWidthrectHeight)

    local spacing 0
    for 1#Buttons do
        
    setfillstyle('gradient''linear'200025)
        if 
    Buttons[i].id ~= lastPressed.id then
            addgradcolors
    (0color(155155155), 1.0color(505050))
        else
            
    addgradcolors(0color(505050), 1.0,color(155155155))
        
    end
        Buttons
    [i].id drawroundrect(1010 spacingrectWidth-2020)
        
    local w,measurestring(Buttons[i].text)    
        
    drawtext(Buttons[i].text, (rectWidth/2) - (w/2), 20 spacing - (h/2))
        
    spacing spacing 25
    end
    if $timems lastPressed.time 100 then
        lastPressed
    .id = -1
    end 

  3. #3
    Free User
    Join Date
    Dec 2013
    Posts
    6
    Reputation
    10
    Rep Power
    0

    Wow thats will help a lot, Thankyou bro!

  4. #4
    Free User Donatello's Avatar
    Join Date
    Dec 2013
    Location
    Tuscany, Italy
    Posts
    398
    Reputation
    51
    Rep Power
    21
    Awesome.

  5. #5
    Moderator BUgWT's Avatar
    Join Date
    Dec 2013
    Location
    www.bugwt.com
    Posts
    546
    Reputation
    72
    Rep Power
    22
    Great job


    LATEST SCRIPTS SKYPE
    Got a Question? Add me on Skype!
    bugwt.support

    This image is hosted on a possibly dangerous website (http://mystatus.skype.com/smallclassic/bugwt.support). Please consider reuploading it on Imgur.com.


  6. #6
    Moderator mistgun's Avatar
    Join Date
    Dec 2013
    Location
    Lodz, Poland
    Posts
    1,821
    Reputation
    220
    Rep Power
    26
    Very well!

  7. #7
    Moderator RoxZin xD's Avatar
    Join Date
    Dec 2013
    Location
    Rio de Janeiro
    Posts
    4,914
    Reputation
    109
    Rep Power
    31
    Really awesome, thanks Forgee!



    Troubled Animals Quest [100+]
    ALL
    Feyrist Animals Surface [160+]
    RP
    Feyrist Silencers Underground X1 [180+]
    RP | EK
    Feyrist Silencers Underground X2 [200+]
    RP | EK
    Feyrist Silencers Surface [210+]
    RP | EK
    Rathleton Sewers [240+]
    RP
    Glooth Fairy [350+]
    ED/MS
    Hardcore Draken Walls [400+]
    EK

  8. #8
    Banned
    Join Date
    Dec 2013
    Posts
    556
    Reputation
    18
    Rep Power
    0
    Wow, thanks!

    @Edit: well, how does it work? I'm trying to click on the button, but no waypoint is added ;o
    Do I need new section w/o renaming it?
    Last edited by K4r4biN; 12-23-2013 at 09:50 AM.

  9. #9
    Free User Forgee's Avatar
    Join Date
    Dec 2013
    Location
    Sweden
    Posts
    5
    Reputation
    16
    Rep Power
    0
    Thanks everyone!

    @K4r4biN waypoints are simply added to the current section (marked with the little running guy). All you need to do is make sure the section you want to add waypoints to is selected in Cavebot. If you keep having problems, please let me know and I'll do my best to figure out why.

  10. #10
    Banned
    Join Date
    Dec 2013
    Location
    United States
    Posts
    848
    Reputation
    30
    Rep Power
    0
    Beautiful work of art mate, Hope you are here to stay on WindBot that is.

 

 

Posting Permissions

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