Results 1 to 2 of 2
Like Tree2Likes
  • 2 Post By Seatbelt99

[AHK] Status Bar

This is a discussion on [AHK] Status Bar within the Source Code Samples forums, part of the Programming category; I thought I'd post this real quick because its something very simple that can make your bots look a lot ...

  1. #1
    Seatbelt99's Avatar
    Seatbelt99 is offline Site Owner
    Join Date
    Apr 2008
    Location
    Somewhere North of you
    Posts
    3,431

    Default [AHK] Status Bar

    I thought I'd post this real quick because its something very simple that can make your bots look a lot better (IMHO).

    Its a simple status bar. In the past when trying to update the status of a bot I'd always just do a Gui, Add, Text... and then update that as the status changed. It was annoying but it worked. I now just use the status bar option in AHK and it looks WAY better and is WAY easier. Yes, I know its easy but I did not know about it until just a few weeks ago so maybe you did not know about it either. Here you go:

    This will add a statusbar at the bottom of your gui with the text "loading":
    Code:
    Gui, Add, StatusBar,, Loading
    Now, anywhere you want to update the status bar just do this:
    Code:
    SB_SetText("New Status Bla bla bla")
    There are some additional options you can play with like having multiple parts to a status and you can read about that in the AHK help file or post here if you have questions!
    Houdini and Nachoman like this.

  2.   Alt These ads help cover server costs and such.


  3. #2
    Nachoman's Avatar
    Nachoman is offline Superhero in disguise
    Join Date
    Oct 2008
    Posts
    1,654

    Default

    Yeah I have always liked status bars

    Here is a working example. I just typed it out head so not pretty LOL But, past into a new AHK script and run it you will see..That is the best way to learn is to play with the code

    Code:
    
    ;
    ; AutoHotkey Version: 1.x
    ; Language:       English
    ; Platform:       Win9x/NT
    ; Author:         A.N.Other <myemail@nowhere.com>
    ;
    ; Script Function:
    ;	Template script (you can customize this template by editing "ShellNew\Template.ahk" in your Windows folder)
    ;
    
    #NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
    SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
    SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
    
    
    
    
    Gui +LastFound
    Gui, Color, 000000
    Gui, Add, Button, x5 y5 w150 h20 ,ClickMe
    Gui, Add, StatusBar,,Click To Start
    
    Gui, Show,h95 w160, StatusBar
    Return
    
    
    ButtonClickMe:
    Gui, Submit, NoHide
    
    Loop, 1
    
    {
    
    SB_SetText("You clicked the button")
    
    Sleep, 2000
    
    SB_SetText("I slept for 2 seconds")
    
    Sleep, 1000
    
    SB_SetText("Click to Start")
    
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Facebook Bots | Admin Forum