Jump to content
Sign in to follow this  
Golbez

progress bar

Recommended Posts

Golbez

can someone help me... i dont understand how i can make it move..

i got it move 1 bar but then it just stops...

Opt("GUIOnEventMode", 1)
;Other$$
    $game = IniRead("WMO.ini", "Other", "game", "NotFound")
    $ct = IniRead("WMO.ini", "Other", "timestocast", "NotFound")
    $lt = IniRead("WMO.ini", "Other", "timestoloot", "NotFound")
    $fd = IniRead("WMO.ini", "Other", "iniprogram", "NotFound")
    $uk = IniRead("WMO.ini", "Other", "usehotkeys", "NotFound")

;Delays
    $smn = IniRead("WMO.ini", "Delays", "sitmin", "NotFound")
    $smx = IniRead("WMO.ini", "Delays", "sitmax", "NotFound")
    $sm = IniRead("WMO.ini", "Delays", "sitdelay", "NotFound")
    $wmn = IniRead("WMO.ini", "Delays", "waitmin", "NotFound")
    $wmx = IniRead("WMO.ini", "Delays", "waitmax", "NotFound")
    $wm = IniRead("WMO.ini", "Delays", "waitdelay", "NotFound")
    $lmn = IniRead("WMO.ini", "Delays", "lootmin", "NotFound")
    $lmx = IniRead("WMO.ini", "Delays", "lootmax", "NotFound")
    $lm = IniRead("WMO.ini", "Delays", "lootdelay", "NotFound")
    $sd = IniRead("WMO.ini", "Delays", "skilldelay", "NotFound")
    $md = IniRead("WMO.ini", "Delays", "messagedelay", "NotFound")

;Skills / Keys pressed
    $ms = IniRead("WMO.ini", "Keys", "mainskill", "NotFound")
    $s2 = IniRead("WMO.ini", "Keys", "secondskill", "NotFound")
    $s3 = IniRead("WMO.ini", "Keys", "thirdskill", "NotFound")
    $s4 = IniRead("WMO.ini", "Keys", "fourthskill", "NotFound")
    $s5 = IniRead("WMO.ini", "Keys", "fifthskill", "NotFound")
    $s6 = IniRead("WMO.ini", "Keys", "sixthskill", "NotFound")
    $s7 = IniRead("WMO.ini", "Keys", "seventhskill", "NotFound")
    $s8 = IniRead("WMO.ini", "Keys", "eighthskill", "NotFound")
    $s9 = IniRead("WMO.ini", "Keys", "ninthskill", "NotFound")
    $sk = IniRead("WMO.ini", "Keys", "sitkey", "NotFound")
    $lk = IniRead("WMO.ini", "Keys", "lootkey", "NotFound")
    If $uk = "yes" Then
        $ek = IniRead("WMO.ini", "Hot Keys", "endkey", "NotFound")
        $pk = IniRead("WMO.ini", "Hot Keys", "pausekey", "NotFound")
        $stk = IniRead("WMO.ini", "Hot Keys", "startkey", "NotFound")
        $irk = IniRead("WMO.ini", "Hot Keys", "iniload", "NotFound")
        $iok = IniRead("WMO.ini", "Hot Keys", "iniopen", "NotFound")
        $lkk = IniRead("WMO.ini", "Hot Keys", "lootkeys", "NotFound")
        HotKeySet($ek, "Terminate")
        HotKeySet($pk, "HoldTime")
        HotKeySet($stk, "StartTime")
        HotKeySet($irk, "IniLoad")
        HotKeySet($iok, "OpenIni")  
        HotKeySet($lkk, "Loot") 
    Else
        $ek = -1
        $pk = -1
        $stk = -1
        $irk = -1
        $iok = -1
        $lkk = -1
    EndIf
    
  
#include <GUIConstants.au3>
$NoAfk = GUICreate("No AFK  <=>  By Ray Smith", 697, 49, 311, 628)
$Button1 = GUICtrlCreateButton("Start", 0, 0, 113, 49)
GUICtrlSetTip(-1, "This pauses the program.")
GUICtrlSetOnEvent(-1, "StartTime")
$Button2 = GUICtrlCreateButton("Pause", 120, 0, 113, 49)
GUICtrlSetTip(-1, "Starts the program if it is stopped.")
GUICtrlSetOnEvent(-1, "HoldTime")
$Button3 = GUICtrlCreateButton("Load InI", 240, 0, 113, 49)
GUICtrlSetTip(-1, "This loads the information in the InI file .")
GUICtrlSetOnEvent(-1, "IniLoad")
$Button4 = GUICtrlCreateButton("Open InI", 360, 0, 105, 49, 0)
GUICtrlSetTip(-1, "This opens the ini with the set program.")
GUICtrlSetOnEvent(-1, "OpenIni")
$Button5 = GUICtrlCreateButton("Loot", 472, 0, 105, 33, 0)
GUICtrlSetTip(-1, "Loots the items on the ground.")
GUICtrlSetOnEvent(-1, "Loot")
$Progress = GUICtrlCreateProgress(477, 33, 95, 14,$PBS_SMOOTH)
GUICtrlSetColor(-1, 0x4A4A4A)
GUISetState ()
$Button6 = GUICtrlCreateButton("Exit", 584, 0, 113, 49)
GUICtrlSetOnEvent(-1, "Terminate")
GUICtrlSetCursor ($Button6, 7)
GUISetState(@SW_SHOW)

WinActivate($game)
$x = 2
While $x > 0
    While $x = 1
        For $e = 1 to $ct
            IF WinActive ( $game ) = 0 Then WinActivate($game )
            Send ($ms)
            If $e < $ct then
                $randsitdelay = Random($smn, $smx, 1); generate an integer between -100 and 100
                Sleep ($sd + $randsitdelay)
            EndIf
        Next
        $randsitdelay = Random($smn, $smx, 1); generate an integer between -100 and 100
        Sleep ($sm + $randsitdelay)
        IF WinActive ( $game ) = 0 Then WinActivate($game )
        For $a = 1 to ($ct + 3)
            Send ($sk)
        Next
        $randwaitdelay = Random(-$wmn, $wmx, 1); generate an integer between -5000 and 5000
        Sleep (($wm * $ct) + $randwaitdelay)
    WEnd
WEnd


Func HoldTime()
    $x = 2
    MsgBox(48, "", "Paused", $md)
EndFunc
Func StartTime()
    MsgBox(48, "", "Started", $md)
    $x = 1
EndFunc
Func Terminate()
    Exit 0
EndFunc
Func IniLoad()
    MsgBox(64, "", "InI loaded", $md)
   ;Other$$
        $game = IniRead("WMO.ini", "Other", "game", "NotFound")
        $ct = IniRead("WMO.ini", "Other", "timestocast", "NotFound")
        $lt = IniRead("WMO.ini", "Other", "timestoloot", "NotFound")
        $fd = IniRead("WMO.ini", "Other", "iniprogram", "NotFound")
        $uk = IniRead("WMO.ini", "Other", "usehotkeys", "NotFound")

   ;Delays
        $smn = IniRead("WMO.ini", "Delays", "sitmin", "NotFound")
        $smx = IniRead("WMO.ini", "Delays", "sitmax", "NotFound")
        $sm = IniRead("WMO.ini", "Delays", "sitdelay", "NotFound")
        $wmn = IniRead("WMO.ini", "Delays", "waitmin", "NotFound")
        $wmx = IniRead("WMO.ini", "Delays", "waitmax", "NotFound")
        $wm = IniRead("WMO.ini", "Delays", "waitdelay", "NotFound")
        $lmn = IniRead("WMO.ini", "Delays", "lootmin", "NotFound")
        $lmx = IniRead("WMO.ini", "Delays", "lootmax", "NotFound")
        $lm = IniRead("WMO.ini", "Delays", "lootdelay", "NotFound")
        $sd = IniRead("WMO.ini", "Delays", "skilldelay", "NotFound")
        $md = IniRead("WMO.ini", "Delays", "messagedelay", "NotFound")

   ;Skills / Keys pressed
        $ms = IniRead("WMO.ini", "Keys", "mainskill", "NotFound")
        $s2 = IniRead("WMO.ini", "Keys", "secondskill", "NotFound")
        $s3 = IniRead("WMO.ini", "Keys", "thirdskill", "NotFound")
        $s4 = IniRead("WMO.ini", "Keys", "fourthskill", "NotFound")
        $s5 = IniRead("WMO.ini", "Keys", "fifthskill", "NotFound")
        $s6 = IniRead("WMO.ini", "Keys", "sixthskill", "NotFound")
        $s7 = IniRead("WMO.ini", "Keys", "seventhskill", "NotFound")
        $s8 = IniRead("WMO.ini", "Keys", "eighthskill", "NotFound")
        $s9 = IniRead("WMO.ini", "Keys", "ninthskill", "NotFound")
        $sk = IniRead("WMO.ini", "Keys", "sitkey", "NotFound")
        $lk = IniRead("WMO.ini", "Keys", "lootkey", "NotFound")
        If $uk = "yes" Then
            $ek = IniRead("WMO.ini", "Hot Keys", "endkey", "NotFound")
            $pk = IniRead("WMO.ini", "Hot Keys", "pausekey", "NotFound")
            $stk = IniRead("WMO.ini", "Hot Keys", "startkey", "NotFound")
            $irk = IniRead("WMO.ini", "Hot Keys", "iniload", "NotFound")
            $iok = IniRead("WMO.ini", "Hot Keys", "iniopen", "NotFound")
            $lkk = IniRead("WMO.ini", "Hot Keys", "lootkeys", "NotFound")
            HotKeySet($ek, "Terminate")
            HotKeySet($pk, "HoldTime")
            HotKeySet($stk, "StartTime")
            HotKeySet($irk, "IniLoad")
            HotKeySet($iok, "OpenIni")  
            HotKeySet($lkk, "Loot") 
        Else
            $ek = -1
            $pk = -1
            $stk = -1
            $irk = -1
            $iok = -1
            $lkk = -1
        EndIf
EndFunc
Func OpenIni()
    MsgBox(64, "", "ini File opened", $md)
    Run($fd & " WMO.ini","", @SW_MAXIMIZE)
EndFunc
Func Loot()
    For $loot = 0 to $lt
        GUICtrlSetData ($button5,"Stop")
        IF WinActive ( $game ) = 0 Then WinActivate($game )
        Send ($lk)
        GUICtrlSetData ($progress,$loot)
        $randlootdelay = Random($lmn, $lmx, 1); generate an integer between -100 and 100
        Sleep ($lm + $randlootdelay)
    Next
    GUICtrlSetData ($button5,"Loot")
    If GUICtrlRead($progress) = 100 Then Msgbox(0,"Info","Loot is done.", 1)
EndFunc

Share this post


Link to post
Share on other sites
Zedna

$lt = IniRead("WMO.ini", "Other", "timestoloot", "NotFound")

For $loot = 0 to $lt

GUICtrlSetData ($progress,$loot)

Progress has percents (0 - 100) as data value, so you must calculate it from

$lt (and max. value) to percents.

Share this post


Link to post
Share on other sites
Valuater

this should work.... it will show errors on the global stuff.. but it will run

******** NOT TESTED

Opt("GUIOnEventMode", 1)

Dim $Looter = 0

; iniload function called here
IniLoad()
  
#include <GUIConstants.au3>
$NoAfk = GUICreate("No AFK  <=>  By Ray Smith", 697, 49, 311, 628)
$Button1 = GUICtrlCreateButton("Start", 0, 0, 113, 49)
GUICtrlSetTip(-1, "This pauses the program.")
GUICtrlSetOnEvent(-1, "StartTime")
$Button2 = GUICtrlCreateButton("Pause", 120, 0, 113, 49)
GUICtrlSetTip(-1, "Starts the program if it is stopped.")
GUICtrlSetOnEvent(-1, "HoldTime")
$Button3 = GUICtrlCreateButton("Load InI", 240, 0, 113, 49)
GUICtrlSetTip(-1, "This loads the information in the InI file .")
GUICtrlSetOnEvent(-1, "IniLoad")
$Button4 = GUICtrlCreateButton("Open InI", 360, 0, 105, 49, 0)
GUICtrlSetTip(-1, "This opens the ini with the set program.")
GUICtrlSetOnEvent(-1, "OpenIni")
$Button5 = GUICtrlCreateButton("Loot", 472, 0, 105, 33, 0)
GUICtrlSetTip(-1, "Loots the items on the ground.")
GUICtrlSetOnEvent(-1, "Loot")
$Progress = GUICtrlCreateProgress(477, 33, 95, 14,$PBS_SMOOTH)
GUICtrlSetColor(-1, 0x4A4A4A)
GUISetState ()
$Button6 = GUICtrlCreateButton("Exit", 584, 0, 113, 49)
GUICtrlSetOnEvent(-1, "Terminate")
GUICtrlSetCursor ($Button6, 7)
GUISetState(@SW_SHOW)

GUISetOnEvent( $GUI_EVENT_CLOSE, "Terminate", $NoAfk)

WinActivate($game)
$x = 2
While $x > 0
    While $x = 1
        For $e = 1 to $ct
            IF WinActive ( $game ) = 0 Then WinActivate($game )
            Send ($ms)
            If $e < $ct then
                $randsitdelay = Random($smn, $smx, 1); generate an integer between -100 and 100
                Sleep ($sd + $randsitdelay)
            EndIf
        Next
        $randsitdelay = Random($smn, $smx, 1); generate an integer between -100 and 100
        Sleep ($sm + $randsitdelay)
        IF WinActive ( $game ) = 0 Then WinActivate($game )
        For $a = 1 to ($ct + 3)
            Send ($sk)
        Next
        $randwaitdelay = Random(-$wmn, $wmx, 1); generate an integer between -5000 and 5000
        Sleep (($wm * $ct) + $randwaitdelay)
    WEnd
    
    If $Looter = 1 Then
        $Ploot = 100 / $lt
        For $loot = 1 to $lt
            If $Looter = 0 Then ExitLoop
            IF Not WinActive($game) Then WinActivate($game)
            Send ($lk)
            GUICtrlSetData ($progress,$loot * $Ploot)
            $randlootdelay = Random($lmn, $lmx, 1); generate an integer between -100 and 100
            Sleep ($lm + $randlootdelay)
        Next
        If GUICtrlRead($progress) = 100 Then Msgbox(0,"Info","Loot is done.", 1)
    EndIf
    Sleep(10)
WEnd


Func HoldTime()
    $x = 2
    MsgBox(48, "", "Paused", $md)
EndFunc
Func StartTime()
    MsgBox(48, "", "Started", $md)
    $x = 1
EndFunc
Func Terminate()
    Exit 0
EndFunc
Func IniLoad()
    
  ;Other$$
        Global $game = IniRead("WMO.ini", "Other", "game", "NotFound")
        Global $ct = IniRead("WMO.ini", "Other", "timestocast", "NotFound")
        Global $lt = IniRead("WMO.ini", "Other", "timestoloot", "NotFound")
        Global $fd = IniRead("WMO.ini", "Other", "iniprogram", "NotFound")
        Global $uk = IniRead("WMO.ini", "Other", "usehotkeys", "NotFound")

  ;Delays
        Global $smn = IniRead("WMO.ini", "Delays", "sitmin", "NotFound")
        Global $smx = IniRead("WMO.ini", "Delays", "sitmax", "NotFound")
        Global $sm = IniRead("WMO.ini", "Delays", "sitdelay", "NotFound")
        Global $wmn = IniRead("WMO.ini", "Delays", "waitmin", "NotFound")
        Global $wmx = IniRead("WMO.ini", "Delays", "waitmax", "NotFound")
        Global $wm = IniRead("WMO.ini", "Delays", "waitdelay", "NotFound")
        Global $lmn = IniRead("WMO.ini", "Delays", "lootmin", "NotFound")
        Global $lmx = IniRead("WMO.ini", "Delays", "lootmax", "NotFound")
        Global $lm = IniRead("WMO.ini", "Delays", "lootdelay", "NotFound")
        Global $sd = IniRead("WMO.ini", "Delays", "skilldelay", "NotFound")
        Global $md = IniRead("WMO.ini", "Delays", "messagedelay", 3)

  ;Skills / Keys pressed
        Global $ms = IniRead("WMO.ini", "Keys", "mainskill", "NotFound")
        Global $s2 = IniRead("WMO.ini", "Keys", "secondskill", "NotFound")
        Global $s3 = IniRead("WMO.ini", "Keys", "thirdskill", "NotFound")
        Global $s4 = IniRead("WMO.ini", "Keys", "fourthskill", "NotFound")
        Global $s5 = IniRead("WMO.ini", "Keys", "fifthskill", "NotFound")
        Global $s6 = IniRead("WMO.ini", "Keys", "sixthskill", "NotFound")
        Global $s7 = IniRead("WMO.ini", "Keys", "seventhskill", "NotFound")
        Global $s8 = IniRead("WMO.ini", "Keys", "eighthskill", "NotFound")
        Global $s9 = IniRead("WMO.ini", "Keys", "ninthskill", "NotFound")
        Global $sk = IniRead("WMO.ini", "Keys", "sitkey", "NotFound")
        Global $lk = IniRead("WMO.ini", "Keys", "lootkey", "NotFound")
        If $uk = "yes" Then
            Global $ek = IniRead("WMO.ini", "Hot Keys", "endkey", "NotFound")
            Global $pk = IniRead("WMO.ini", "Hot Keys", "pausekey", "NotFound")
            Global $stk = IniRead("WMO.ini", "Hot Keys", "startkey", "NotFound")
            Global $irk = IniRead("WMO.ini", "Hot Keys", "iniload", "NotFound")
            Global $iok = IniRead("WMO.ini", "Hot Keys", "iniopen", "NotFound")
            Global $lkk = IniRead("WMO.ini", "Hot Keys", "lootkeys", "NotFound")
            HotKeySet($ek, "Terminate")
            HotKeySet($pk, "HoldTime")
            HotKeySet($stk, "StartTime")
            HotKeySet($irk, "IniLoad")
            HotKeySet($iok, "OpenIni")  
            HotKeySet($lkk, "Loot") 
        Else
            Global $ek = -1
            Global $pk = -1
            Global $stk = -1
            Global $irk = -1
            Global $iok = -1
            Global $lkk = -1
        EndIf
    MsgBox(64, "", "InI loaded", $md)
EndFunc
Func OpenIni()
    MsgBox(64, "", "ini File opened", $md)
    Run($fd & " WMO.ini","", @SW_MAXIMIZE)
EndFunc
Func Loot()
    If $Looter = 0 Then
        GUICtrlSetData ($button5,"Stop")
        $Looter = 1
    Else
        GUICtrlSetData ($button5,"Loot")
        $Looter = 0
    EndIf
EndFunc

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
Golbez

no errors..

but how do i make it so the status bar will go blank after the looting is done?

Share this post


Link to post
Share on other sites
AzKay

GUICtrlSetData() ?


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites
Golbez

where would i put it tho?

Share this post


Link to post
Share on other sites
SmOke_N
:whistle: Right after where ever it increases at?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
Golbez

well that worked..

but it doesnt seem like it will stop untill i press the button again..

anyway 2 stop this?

updated code: (i made it so people dont have to use the progress bar :whistle:)

Opt("GUIOnEventMode", 1)
Dim $Looter = 0
$start = 0
IniLoad() ; iniload function called here
$start = 1
#include <GUIConstants.au3>
$NoAfk = GUICreate("No AFK  <=>  By Ray Smith", 697, 49, 311, 628)
$Button1 = GUICtrlCreateButton("Start", 0, 0, 113, 49)
    GUICtrlSetTip(-1, "This pauses the program.")
    GUICtrlSetOnEvent(-1, "StartTime")
$Button2 = GUICtrlCreateButton("Pause", 120, 0, 113, 49)
    GUICtrlSetTip(-1, "Starts the program if it is stopped.")
    GUICtrlSetOnEvent(-1, "HoldTime")
$Button3 = GUICtrlCreateButton("Load InI", 240, 0, 113, 49)
    GUICtrlSetTip(-1, "This loads the information in the InI file .")
    GUICtrlSetOnEvent(-1, "IniLoad")
$Button4 = GUICtrlCreateButton("Open InI", 360, 0, 105, 49, 0)
    GUICtrlSetTip(-1, "This opens the ini with the set program.")
    GUICtrlSetOnEvent(-1, "OpenIni")
If $useprogress = "yes" Then 
    $Button5 = GUICtrlCreateButton("Loot", 472, 0, 105, 33, 0)
        GUICtrlSetTip(-1, "Loots the items on the ground.")
        GUICtrlSetOnEvent(-1, "Loot")
    $Progress = GUICtrlCreateProgress(477, 33, 95, 14,$PBS_SMOOTH)
        GUICtrlSetColor(-1, 0x4A4A4A)
Else
    $Button5 = GUICtrlCreateButton("Loot", 472, 0, 105, 49, 0)
        GUICtrlSetTip(-1, "Loots the items on the ground.")
        GUICtrlSetOnEvent(-1, "Loot")
EndIf
$Button6 = GUICtrlCreateButton("Exit", 584, 0, 113, 49)
    GUICtrlSetOnEvent(-1, "Terminate")
    GUICtrlSetCursor ($Button6, 7)
GUISetState(@SW_SHOW)

GUISetOnEvent($GUI_EVENT_CLOSE, "Terminate", $NoAfk)

WinActivate($game)
$x = 2
While $x > 0
    While $x = 1
        For $e = 1 to $ct
            IF WinActive ( $game ) = 0 Then WinActivate($game )
            Send ($ms)
            If $e < $ct then
                $randsitdelay = Random($smn, $smx, 1); generate an integer between -100 and 100
                Sleep ($sd + $randsitdelay)
            EndIf
        Next
        $randsitdelay = Random($smn, $smx, 1); generate an integer between -100 and 100
        Sleep ($sm + $randsitdelay)
        IF WinActive ( $game ) = 0 Then WinActivate($game )
        For $a = 1 to ($ct + 3)
            Send ($sk)
        Next
        $randwaitdelay = Random(-$wmn, $wmx, 1); generate an integer between -5000 and 5000
        Sleep (($wm * $ct) + $randwaitdelay)
    WEnd
    
    If $Looter = 1 Then
        If $useprogress = "yes" Then $Ploot = 100 / $lt
        For $loot = 1 to $lt
            If $Looter = 0 Then ExitLoop
            IF Not WinActive($game) Then WinActivate($game)
            Send ($lk)
            If $useprogress = "yes" Then GUICtrlSetData ($progress,$loot * $Ploot)
            $randlootdelay = Random($lmn, $lmx, 1); generate an integer between -100 and 100
            Sleep ($lm + $randlootdelay)
        Next
        If $useprogress = "yes" Then 
            GUICtrlSetData ($progress,0)
            GUICtrlSetData ($button5,"Loot")
            If GUICtrlRead($progress) = 100 Then $Looter = 0   
            If GUICtrlRead($progress) = 100 Then Msgbox(0,"Info","Loot is done.", 1)
        EndIf
    EndIf
    Sleep(10)
WEnd


Func HoldTime()
    $x = 2
    MsgBox(48, "", "Paused", $md)
EndFunc
Func StartTime()
    MsgBox(48, "", "Started", $md)
    $x = 1
EndFunc
Func Terminate()
    Exit 0
EndFunc
Func IniLoad()
   ;Other$$
        Global $game = IniRead("WMO.ini", "Other", "game", "NotFound")
        Global $ct = IniRead("WMO.ini", "Other", "timestocast", "NotFound")
        Global $lt = IniRead("WMO.ini", "Other", "timestoloot", "NotFound")
        Global $fd = IniRead("WMO.ini", "Other", "iniprogram", "NotFound")
        Global $uk = IniRead("WMO.ini", "Other", "usehotkeys", "NotFound")
        Global $useprogress = IniRead("WMO.ini", "Other", "useprogressbar", "NotFound")
   ;Delays
        Global $smn = IniRead("WMO.ini", "Delays", "sitmin", "NotFound")
        Global $smx = IniRead("WMO.ini", "Delays", "sitmax", "NotFound")
        Global $sm = IniRead("WMO.ini", "Delays", "sitdelay", "NotFound")
        Global $wmn = IniRead("WMO.ini", "Delays", "waitmin", "NotFound")
        Global $wmx = IniRead("WMO.ini", "Delays", "waitmax", "NotFound")
        Global $wm = IniRead("WMO.ini", "Delays", "waitdelay", "NotFound")
        Global $lmn = IniRead("WMO.ini", "Delays", "lootmin", "NotFound")
        Global $lmx = IniRead("WMO.ini", "Delays", "lootmax", "NotFound")
        Global $lm = IniRead("WMO.ini", "Delays", "lootdelay", "NotFound")
        Global $sd = IniRead("WMO.ini", "Delays", "skilldelay", "NotFound")
        Global $md = IniRead("WMO.ini", "Delays", "messagedelay", 3)
   ;Skills / Keys pressed
        Global $ms = IniRead("WMO.ini", "Keys", "mainskill", "NotFound")
        Global $s2 = IniRead("WMO.ini", "Keys", "secondskill", "NotFound")
        Global $s3 = IniRead("WMO.ini", "Keys", "thirdskill", "NotFound")
        Global $s4 = IniRead("WMO.ini", "Keys", "fourthskill", "NotFound")
        Global $s5 = IniRead("WMO.ini", "Keys", "fifthskill", "NotFound")
        Global $s6 = IniRead("WMO.ini", "Keys", "sixthskill", "NotFound")
        Global $s7 = IniRead("WMO.ini", "Keys", "seventhskill", "NotFound")
        Global $s8 = IniRead("WMO.ini", "Keys", "eighthskill", "NotFound")
        Global $s9 = IniRead("WMO.ini", "Keys", "ninthskill", "NotFound")
        Global $sk = IniRead("WMO.ini", "Keys", "sitkey", "NotFound")
        Global $lk = IniRead("WMO.ini", "Keys", "lootkey", "NotFound")
        If $uk = "yes" Then
            Global $ek = IniRead("WMO.ini", "Hot Keys", "endkey", "NotFound")
            Global $pk = IniRead("WMO.ini", "Hot Keys", "pausekey", "NotFound")
            Global $stk = IniRead("WMO.ini", "Hot Keys", "startkey", "NotFound")
            Global $irk = IniRead("WMO.ini", "Hot Keys", "iniload", "NotFound")
            Global $iok = IniRead("WMO.ini", "Hot Keys", "iniopen", "NotFound")
            Global $lkk = IniRead("WMO.ini", "Hot Keys", "lootkeys", "NotFound")
            HotKeySet($ek, "Terminate")
            HotKeySet($pk, "HoldTime")
            HotKeySet($stk, "StartTime")
            HotKeySet($irk, "IniLoad")
            HotKeySet($iok, "OpenIni")  
            HotKeySet($lkk, "Loot") 
        Else
            Global $ek = -1
            Global $pk = -1
            Global $stk = -1
            Global $irk = -1
            Global $iok = -1
            Global $lkk = -1
        EndIf
    If $start = 1 Then MsgBox(64, "", "InI loaded", $md)
EndFunc
Func OpenIni()
    MsgBox(64, "", "ini File opened", $md)
    Run($fd & " WMO.ini","", @SW_MAXIMIZE)
EndFunc
Func Loot()
    If $Looter = 0 Then
        GUICtrlSetData ($button5,"Stop Looting")
        $Looter = 1
    Else
        GUICtrlSetData ($button5,"Loot")
        $Looter = 0
    EndIf
EndFunc
Edited by Golbez

Share this post


Link to post
Share on other sites
SmOke_N

If DataPercentage <= 100 Then GUICtrlSetData(ControlID, Data)

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
Golbez

error...

Line 74 (file "C:\Documents and Settings\Ray Smith\My Documents\My Programs\noafk.au3")"

If DataPercentage <= 100 then GUICtrlSetData(ControlID, Data)

If ^ERROR

Error: Unknown function name.

umm??

Update to 2 see if i put it in the right spot:

Opt("GUIOnEventMode", 1)
Dim $Looter = 0
$start = 0
IniLoad() ; iniload function called here
$start = 1
#include <GUIConstants.au3>
$NoAfk = GUICreate("No AFK  <=>  By Ray Smith", 697, 49, 311, 628)
$Button1 = GUICtrlCreateButton("Start", 0, 0, 113, 49)
    GUICtrlSetTip(-1, "This pauses the program.")
    GUICtrlSetOnEvent(-1, "StartTime")
$Button2 = GUICtrlCreateButton("Pause", 120, 0, 113, 49)
    GUICtrlSetTip(-1, "Starts the program if it is stopped.")
    GUICtrlSetOnEvent(-1, "HoldTime")
$Button3 = GUICtrlCreateButton("Load InI", 240, 0, 113, 49)
    GUICtrlSetTip(-1, "This loads the information in the InI file .")
    GUICtrlSetOnEvent(-1, "IniLoad")
$Button4 = GUICtrlCreateButton("Open InI", 360, 0, 105, 49, 0)
    GUICtrlSetTip(-1, "This opens the ini with the set program.")
    GUICtrlSetOnEvent(-1, "OpenIni")
If $useprogress = "yes" Then 
    $Button5 = GUICtrlCreateButton("Loot", 472, 0, 105, 33, 0)
        GUICtrlSetTip(-1, "Loots the items on the ground.")
        GUICtrlSetOnEvent(-1, "Loot")
    $Progress = GUICtrlCreateProgress(477, 33, 95, 14,$PBS_SMOOTH)
        GUICtrlSetColor(-1, 0x4A4A4A)
Else
    $Button5 = GUICtrlCreateButton("Loot", 472, 0, 105, 49, 0)
        GUICtrlSetTip(-1, "Loots the items on the ground.")
        GUICtrlSetOnEvent(-1, "Loot")
EndIf
$Button6 = GUICtrlCreateButton("Exit", 584, 0, 113, 49)
    GUICtrlSetOnEvent(-1, "Terminate")
    GUICtrlSetCursor ($Button6, 7)
GUISetState(@SW_SHOW)

GUISetOnEvent($GUI_EVENT_CLOSE, "Terminate", $NoAfk)

WinActivate($game)
$x = 2
While $x > 0
    While $x = 1
        For $e = 1 to $ct
            IF WinActive ( $game ) = 0 Then WinActivate($game )
            Send ($ms)
            If $e < $ct then
                $randsitdelay = Random($smn, $smx, 1); generate an integer between -100 and 100
                Sleep ($sd + $randsitdelay)
            EndIf
        Next
        $randsitdelay = Random($smn, $smx, 1); generate an integer between -100 and 100
        Sleep ($sm + $randsitdelay)
        IF WinActive ( $game ) = 0 Then WinActivate($game )
        For $a = 1 to ($ct + 3)
            Send ($sk)
        Next
        $randwaitdelay = Random(-$wmn, $wmx, 1); generate an integer between -5000 and 5000
        Sleep (($wm * $ct) + $randwaitdelay)
    WEnd
    
    If $Looter = 1 Then
        
        If $useprogress = "yes" Then
            $Ploot = 100 / $lt
            For $loot = 1 to $lt
                If $Looter = 0 Then ExitLoop
                IF Not WinActive($game) Then WinActivate($game)
                Send ($lk)
                GUICtrlSetData ($progress,$loot * $Ploot)
                $randlootdelay = Random($lmn, $lmx, 1); generate an integer between -100 and 100
                Sleep ($lm + $randlootdelay)
            Next
            GUICtrlSetData ($progress,0)
            GUICtrlSetData ($button5,"Loot")
            If DataPercentage <= 100 Then GUICtrlSetData(ControlID, Data)
            If GUICtrlRead($progress) = 100 Then Msgbox(0,"Info","Loot is done.", 1)
        Else
            For $loot = 1 to 1
                If $Looter = 0 Then ExitLoop
                IF Not WinActive($game) Then WinActivate($game)
                Send ($lk)
                $randlootdelay = Random($lmn, $lmx, 1); generate an integer between -100 and 100
                Sleep ($lm + $randlootdelay)
            Next
        EndIf
    EndIf
    Sleep(10)
WEnd


Func HoldTime()
    $x = 2
    MsgBox(48, "", "Paused", $md)
EndFunc
Func StartTime()
    MsgBox(48, "", "Started", $md)
    $x = 1
EndFunc
Func Terminate()
    Exit 0
EndFunc
Func IniLoad()
;Other$$
        Global $game = IniRead("WMO.ini", "Other", "game", "NotFound")
        Global $ct = IniRead("WMO.ini", "Other", "timestocast", "NotFound")
        Global $lt = IniRead("WMO.ini", "Other", "timestoloot", "NotFound")
        Global $fd = IniRead("WMO.ini", "Other", "iniprogram", "NotFound")
        Global $uk = IniRead("WMO.ini", "Other", "usehotkeys", "NotFound")
        Global $useprogress = IniRead("WMO.ini", "Other", "useprogressbar", "NotFound")
;Delays
        Global $smn = IniRead("WMO.ini", "Delays", "sitmin", "NotFound")
        Global $smx = IniRead("WMO.ini", "Delays", "sitmax", "NotFound")
        Global $sm = IniRead("WMO.ini", "Delays", "sitdelay", "NotFound")
        Global $wmn = IniRead("WMO.ini", "Delays", "waitmin", "NotFound")
        Global $wmx = IniRead("WMO.ini", "Delays", "waitmax", "NotFound")
        Global $wm = IniRead("WMO.ini", "Delays", "waitdelay", "NotFound")
        Global $lmn = IniRead("WMO.ini", "Delays", "lootmin", "NotFound")
        Global $lmx = IniRead("WMO.ini", "Delays", "lootmax", "NotFound")
        Global $lm = IniRead("WMO.ini", "Delays", "lootdelay", "NotFound")
        Global $sd = IniRead("WMO.ini", "Delays", "skilldelay", "NotFound")
        Global $md = IniRead("WMO.ini", "Delays", "messagedelay", 3)
;Skills / Keys pressed
        Global $ms = IniRead("WMO.ini", "Keys", "mainskill", "NotFound")
        Global $s2 = IniRead("WMO.ini", "Keys", "secondskill", "NotFound")
        Global $s3 = IniRead("WMO.ini", "Keys", "thirdskill", "NotFound")
        Global $s4 = IniRead("WMO.ini", "Keys", "fourthskill", "NotFound")
        Global $s5 = IniRead("WMO.ini", "Keys", "fifthskill", "NotFound")
        Global $s6 = IniRead("WMO.ini", "Keys", "sixthskill", "NotFound")
        Global $s7 = IniRead("WMO.ini", "Keys", "seventhskill", "NotFound")
        Global $s8 = IniRead("WMO.ini", "Keys", "eighthskill", "NotFound")
        Global $s9 = IniRead("WMO.ini", "Keys", "ninthskill", "NotFound")
        Global $sk = IniRead("WMO.ini", "Keys", "sitkey", "NotFound")
        Global $lk = IniRead("WMO.ini", "Keys", "lootkey", "NotFound")
        If $uk = "yes" Then
            Global $ek = IniRead("WMO.ini", "Hot Keys", "endkey", "NotFound")
            Global $pk = IniRead("WMO.ini", "Hot Keys", "pausekey", "NotFound")
            Global $stk = IniRead("WMO.ini", "Hot Keys", "startkey", "NotFound")
            Global $irk = IniRead("WMO.ini", "Hot Keys", "iniload", "NotFound")
            Global $iok = IniRead("WMO.ini", "Hot Keys", "iniopen", "NotFound")
            Global $lkk = IniRead("WMO.ini", "Hot Keys", "lootkeys", "NotFound")
            HotKeySet($ek, "Terminate")
            HotKeySet($pk, "HoldTime")
            HotKeySet($stk, "StartTime")
            HotKeySet($irk, "IniLoad")
            HotKeySet($iok, "OpenIni")  
            HotKeySet($lkk, "Loot") 
        Else
            Global $ek = -1
            Global $pk = -1
            Global $stk = -1
            Global $irk = -1
            Global $iok = -1
            Global $lkk = -1
        EndIf
    If $start = 1 Then MsgBox(64, "", "InI loaded", $md)
EndFunc
Func OpenIni()
    MsgBox(64, "", "ini File opened", $md)
    Run($fd & " WMO.ini","", @SW_MAXIMIZE)
EndFunc
Func Loot()
    If $Looter = 0 Then
        GUICtrlSetData ($button5,"Stop Looting")
        $Looter = 1
    Else
        GUICtrlSetData ($button5,"Loot")
        $Looter = 0
    EndIf
EndFunc

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×