Jump to content

help... few problems


Golbez
 Share

Recommended Posts

1. i cant get this timer working :)

2. cant get the time working.. it creates alot of errors that i dont know/dont reamber how 2 fix

3. cant get radio buttons 2 work with the ini load.. (it should write cast spot selected to the ini then reload the ini)

someone give me more info/help plz?

Opt("GUIONEVENTMODE", 1)
#include <GUIConstants.au3>
#include <Date.au3>

Global $time, $game, $skillkey, $mousekey, $x, $y, $ek, $delay1, $skilldelay, $pause, $t, $pk, $p
Global $Button1, $Button2, $Button3, $iHour, $AMPM, $iCHK, $iPid, $iCTime, $Secs, $Mins, $Hour, $Time
Dim $dupe = 0

$Duper = GUICreate("Dupe Helper", 154, 597, 799, 1, BitOR($WS_CAPTION,$WS_BORDER,$WS_CLIPSIBLINGS))
$Group1 = GUICtrlCreateGroup("Cast Spots", 8, 440, 137, 105)
$Radio1 = GUICtrlCreateRadio("Top Left", 32, 472, 97, 17)
$Radio2 = GUICtrlCreateRadio("Top Right", 32, 488, 97, 17)
$Radio3 = GUICtrlCreateRadio("Bottom Left", 32, 504, 97, 17)
$Radio4 = GUICtrlCreateRadio("Bottom Right", 32, 520, 97, 17)
$Radio5 = GUICtrlCreateRadio("Center", 32, 456, 97, 17)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button1 = GUICtrlCreateButton("Exit", 8, 552, 137, 41, 0)
    GUICtrlSetOnEvent(-1, "Terminate")
    GUICtrlSetCursor ($Button1, 7)
$Button2 = GUICtrlCreateButton("Start Dupe", 8, 344, 137, 41, 0)
    GUICtrlSetOnEvent(-1, "pause")
$Button3 = GUICtrlCreateButton("Load Ini", 8, 392, 137, 41, 0)
    GUICtrlSetTip(-1, "This loads the information in the InI file .")
    GUICtrlSetOnEvent(-1, "iniload")
$Group2 = GUICtrlCreateGroup("Time Spend In Game", 8, 8, 137, 57, $BS_CENTER)
    GUICtrlCreateLabel("00:00:00", 55, 32)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group3 = GUICtrlCreateGroup("Current Time", 8, 72, 137, 57, $BS_CENTER)
$iCTime = GUICtrlCreateLabel('' & @CRLF & _GetHour(@HOUR) & ':' & @MIN & ':' & @SEC & ' ' & $AMPM _ 
        , 16, 88, 120, 27, BitOR($SS_CENTER,$SS_CENTERIMAGE))
    GUICtrlCreateGroup("", -99, -99, 1, 1)
$Label2 = GUICtrlCreateLabel("Made by: Ray Smith ", 8, 144, 134, 17, $SS_CENTER)
$Label4 = GUICtrlCreateLabel("I take no blame if you get banned for  breaking the rules. (duping, hacking, etc.)", 8, 296, 139, 41, $SS_CENTER)
$Label5 = GUICtrlCreateLabel("Feel free to contact me:            MasterGolbez37@Gmail.com Aim: Zephino ", 8, 200, 140, 60)
GUISetState(@SW_SHOW)
GUISetOnEvent($GUI_EVENT_CLOSE, "Terminate", $Duper)
$timer = TimerInit()
AdlibEnable("Timer", 50)
$p = 2
While $p > 0
    loadini()
    Sleep(1000)
    _AdlibManager()
WEnd

Func loadini()
  ;Other    
    $game = IniRead("d2dupe.ini", "other", "game", "Error")
    $skillkey = IniRead("d2dupe.ini", "other", "skillkey", "Error")
    $mousekey =  IniRead("d2dupe.ini", "other", "mousekey", "Error")
    $ek = IniRead("d2dupe.ini", "other", "endkey", "Error")
    $pk = IniRead("d2dupe.ini", "other", "sleepkey", "Error")
    $ik = IniRead("d2dupe.ini", "other", "inikey", "Error")
    
  ;Spots To Cast
    $spot = IniRead("d2dupe.ini", "other", "spottocast", "Error")
    If $spot = 1 Then
        $x = IniRead("d2dupe.ini", "Coords", "topleftx", "Error")
        $y = IniRead("d2dupe.ini", "Coords", "toplefty", "Error")
    ElseIf $spot = 2 Then
        $x = IniRead("d2dupe.ini", "Coords", "toprightx", "Error")
        $y = IniRead("d2dupe.ini", "Coords", "toprighty", "Error")
    ElseIf $spot = 3 Then
        $x = IniRead("d2dupe.ini", "Coords", "botleftx", "Error")
        $y = IniRead("d2dupe.ini", "Coords", "botlefty", "Error")
    ElseIf $spot = 4 Then
        $x = IniRead("d2dupe.ini", "Coords", "botrightx", "Error")
        $y = IniRead("d2dupe.ini", "Coords", "botrighty", "Error")
    ElseIf $spot = 5 Then
        $x = IniRead("d2dupe.ini", "Coords", "centerx", "Error")
        $y = IniRead("d2dupe.ini", "Coords", "centery", "Error")
    EndIf
    
  ;Delays
    $delay1 = IniRead("d2dupe.ini", "delays", "maindelay", "Error")
    $skilldelay = IniRead("d2dupe.ini", "delays", "skilldelay", "Error")
HotKeySet($ek, "Terminate")
HotKeySet($pk, "pause")
HotKeySet($ik, "loadini")

EndFunc
Func iniload()
    Opt("GUIOnEventMode", 1)
    $msg = GUIGetMsg()
    Select
        Case $msg = $radio1 And BitAND(GUICtrlRead($radio1), $GUI_CHECKED) = $GUI_CHECKED
            IniWrite ( "d2dupe.ini", "other", "spottocast", "1" )
            MsgBox (1,"ini","ini wrote")
        Case $msg = $radio2 And BitAND(GUICtrlRead($radio2), $GUI_CHECKED) = $GUI_CHECKED
            IniWrite ( "d2dupe.ini", "other", "spottocast", "2" )
            MsgBox (1,"ini","ini wrote")
        Case $msg = $radio3 And BitAND(GUICtrlRead($radio3), $GUI_CHECKED) = $GUI_CHECKED
            IniWrite ( "d2dupe.ini", "other", "spottocast", "3" )
            MsgBox (1,"ini","ini wrote")
        Case $msg = $radio4 And BitAND(GUICtrlRead($radio4), $GUI_CHECKED) = $GUI_CHECKED
            IniWrite ( "d2dupe.ini", "other", "spottocast", "4" )
            MsgBox (1,"ini","ini wrote")
        Case $msg = $radio5 And BitAND(GUICtrlRead($radio5), $GUI_CHECKED) = $GUI_CHECKED
            IniWrite ( "d2dupe.ini", "other", "spottocast", "5" )
            MsgBox (1,"ini","ini wrote")
    EndSelect
    Opt("GUIOnEventMode", 0)
    loadini()
EndFunc
Func Timer()
  _TicksToTime(Int(TimerDiff($timer)), $Hour, $Mins, $Secs )
  Local $sTime = $Time  ; save current time to be able to test and avoid flicker..
  $Time = StringFormat("%02i:%02i:%02i", $Hour, $Mins, $Secs)
  If $sTime <> $Time Then ControlSetText("Timer", "", "Static1", $Time)
EndFunc
Func dupestart()
    While $dupe = 1
        MouseClick($mousekey, $x, $y, 1)
        sleep($skilldelay)
        If $dupe = 0 Then ExitLoop
        Sleep(10)
    WEnd
EndFunc
Func pause()
    If $dupe = 0 Then
        GUICtrlSetData ($button2,"Stop Duping")
        $dupe = 1
        Getready()
    Else
        GUICtrlSetData ($button2,"Start Duping")
        $dupe = 0
    EndIf
EndFunc
Func _AdlibManager()
    Local $aSplit = StringSplit(GUICtrlRead($iCTime), ':')
    If $aSplit[0] >= 3 And (Int($aSplit[1]) >= _GetHour(@HOUR) _
        Or Int($aSplit[2]) >= @MIN Or Int(StringTrimRight($aSplit[3], 3)) > @SEC) Then _
        GUICtrlSetData($iCTime, 'Current Time' & @CRLF & _GetHour(@HOUR) & ':' & @MIN & ':' & @SEC & ' ' & $AMPM)
    EndIf
EndFunc



Func _GetHour($iHour)
    Switch $iHour
        Case 12
            $AMPM = 'PM'
            Return $iHour
        Case 13 To 23
            $AMPM = 'PM'
            Return $iHour - 12
        Case 0
            $AMPM = 'AM'
            Return 12
        Case 1 To 11
            $AMPM = 'AM'
            Return $iHour
    EndSwitch
EndFunc
Func _SwitchHour($iHour)
    Switch $iHour
        Case 12
            If $AMPM = 'AM' Then
                Return 0
            Else
                Return 12
            EndIf
        Case 1 To 11
            If $AMPM = 'PM' Then
                Return $iHour + 12
            Else
                Return $iHour
            EndIf
    EndSwitch
EndFunc
Func Terminate()
    Exit 0
EndFunc
Func HoldTime()
    $p = 2
    MsgBox(48, "", "Paused")
EndFunc
Func StartTime()
    MsgBox(48, "", "Started")
    $p = 1
EndFunc
func Getready()
    If WinActive($game) = 0 Then WinActivate($game)
    Sleep($delay1)
    WinMove($game, "", 0, 0, 800, 630)
    Sleep($delay1)
    MouseMove($x, $y, 2)
    Sleep($delay1)
    ControlSend($game, "", "", $skillkey)
    Sleep($delay1)
    dupestart()
EndFunc

[other]
 game = "Diablo II"
 skillkey = "{f2}"
 mousekey = "RIGHT"
 endkey = {DEL}
 sleepkey = {PGUP}
; Spots to cast
;   1= top left
;   2 = top right
;   3 = bottom left
;   4 = bottom right
;   5 = center
 spottocast = 0
 
 [Coords]
 botleftx = 35
 botlefty = 575
 botrightx = 780
 botrighty = 570
 topleftx = 70
 toplefty = 40
 toprightx = 790
 toprighty = 30
 centerx = 405
 centery = 310
 
 [delays]
 $delay1 = 500
; Default skill delays
;   Fireball = 1600  Bonewall = 450
 $skilldelay = 1600
Link to comment
Share on other sites

Things that go Boom

1

Or Int($aSplit[2]) >= @MIN Or Int(StringTrimRight($aSplit[3], 3)) > @SEC) Then _ ........ Then _

2

While $p > 0

loadini()

Sleep(1000)

_AdlibManager()

WEnd

continually reading the ini file loop after loop ?????

3

Not sure you can "turn off" on event mode... any ways you have it backwards.... even if you could do it

Func iniload()
    Opt("GUIOnEventMode", 1).................................................. 0
    $msg = GUIGetMsg()
    Select
        Case $msg = $radio1 And BitAND(GUICtrlRead($radio1), $GUI_CHECKED) = $GUI_CHECKED
            IniWrite ( "d2dupe.ini", "other", "spottocast", "1" )
            MsgBox (1,"ini","ini wrote")
        Case $msg = $radio2 And BitAND(GUICtrlRead($radio2), $GUI_CHECKED) = $GUI_CHECKED
            IniWrite ( "d2dupe.ini", "other", "spottocast", "2" )
            MsgBox (1,"ini","ini wrote")
        Case $msg = $radio3 And BitAND(GUICtrlRead($radio3), $GUI_CHECKED) = $GUI_CHECKED
            IniWrite ( "d2dupe.ini", "other", "spottocast", "3" )
            MsgBox (1,"ini","ini wrote")
        Case $msg = $radio4 And BitAND(GUICtrlRead($radio4), $GUI_CHECKED) = $GUI_CHECKED
            IniWrite ( "d2dupe.ini", "other", "spottocast", "4" )
            MsgBox (1,"ini","ini wrote")
        Case $msg = $radio5 And BitAND(GUICtrlRead($radio5), $GUI_CHECKED) = $GUI_CHECKED
            IniWrite ( "d2dupe.ini", "other", "spottocast", "5" )
            MsgBox (1,"ini","ini wrote")
    EndSelect
    Opt("GUIOnEventMode", 0)..................................................... 1
    loadini()
EndFunc

maybe just read the radios without "get message"

If BitAND(GUICtrlRead($radio1), $GUI_CHECKED) = $GUI_CHECKED Then

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

thanx..

u can turn it off n on..

i got it 2 work in my alarm clock i made 4 winamp i just dont reamber how i did it.

smoke helped me out alot

code update:

Opt("GUIONEVENTMODE", 1)
#include <GUIConstants.au3>
#include <Date.au3>

Global $time, $game, $skillkey, $mousekey, $x, $y, $ek, $delay1, $skilldelay, $pause, $t, $pk, $p
Global $Button1, $Button2, $Button3, $iHour, $AMPM, $iCHK, $iPid, $iCTime, $Secs, $Mins, $Hour, $Time
Dim $dupe = 0

$Duper = GUICreate("Dupe Helper", 154, 597, 799, 1, BitOR($WS_CAPTION,$WS_BORDER,$WS_CLIPSIBLINGS))
$Group1 = GUICtrlCreateGroup("Cast Spots", 8, 440, 137, 105)
$Radio1 = GUICtrlCreateRadio("Top Left", 32, 472, 97, 17)
$Radio2 = GUICtrlCreateRadio("Top Right", 32, 488, 97, 17)
$Radio3 = GUICtrlCreateRadio("Bottom Left", 32, 504, 97, 17)
$Radio4 = GUICtrlCreateRadio("Bottom Right", 32, 520, 97, 17)
$Radio5 = GUICtrlCreateRadio("Center", 32, 456, 97, 17)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button1 = GUICtrlCreateButton("Exit", 8, 552, 137, 41, 0)
    GUICtrlSetOnEvent(-1, "Terminate")
    GUICtrlSetCursor ($Button1, 7)
$Button2 = GUICtrlCreateButton("Start Dupe", 8, 344, 137, 41, 0)
    GUICtrlSetOnEvent(-1, "pause")
$Button3 = GUICtrlCreateButton("Set Cast Spot", 8, 392, 137, 41, 0)
    GUICtrlSetOnEvent(-1, "iniload")
$Group2 = GUICtrlCreateGroup("Time Spend In Game", 8, 8, 137, 57, $BS_CENTER)
    GUICtrlCreateLabel("00:00:00", 55, 32)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group3 = GUICtrlCreateGroup("Current Time", 8, 72, 137, 57, $BS_CENTER)
$iCTime = GUICtrlCreateLabel('' & @CRLF & _GetHour(@HOUR) & ':' & @MIN & ':' & @SEC & ' ' & $AMPM _ 
        , 16, 88, 120, 27, BitOR($SS_CENTER,$SS_CENTERIMAGE))
    GUICtrlCreateGroup("", -99, -99, 1, 1)
$Label2 = GUICtrlCreateLabel("Made by: Ray Smith ", 8, 144, 134, 17, $SS_CENTER)
$Label4 = GUICtrlCreateLabel("I take no blame if you get banned for  breaking the rules. (duping, hacking, etc.)", 8, 296, 139, 41, $SS_CENTER)
$Label5 = GUICtrlCreateLabel("Feel free to contact me:          MasterGolbez37@Gmail.com Aim: Zephino ", 8, 200, 140, 60)
GUISetState(@SW_SHOW)
GUISetOnEvent($GUI_EVENT_CLOSE, "Terminate", $Duper)
$timer = TimerInit()
AdlibEnable("Timer", 50)
$p = 2
While $p > 0
    loadini()
    Sleep(1000)
   ;_AdlibManager()
WEnd

Func loadini()
 ;Other 
    $game = IniRead("d2dupe.ini", "other", "game", "Error")
    $skillkey = IniRead("d2dupe.ini", "other", "skillkey", "Error")
    $mousekey =  IniRead("d2dupe.ini", "other", "mousekey", "Error")
    $ek = IniRead("d2dupe.ini", "other", "endkey", "Error")
    $pk = IniRead("d2dupe.ini", "other", "sleepkey", "Error")
    $ik = IniRead("d2dupe.ini", "other", "inikey", "Error")
    
 ;Spots To Cast
    $spot = IniRead("d2dupe.ini", "other", "spottocast", "Error")
    If $spot = 1 Then
        $x = IniRead("d2dupe.ini", "Coords", "topleftx", "Error")
        $y = IniRead("d2dupe.ini", "Coords", "toplefty", "Error")
    ElseIf $spot = 2 Then
        $x = IniRead("d2dupe.ini", "Coords", "toprightx", "Error")
        $y = IniRead("d2dupe.ini", "Coords", "toprighty", "Error")
    ElseIf $spot = 3 Then
        $x = IniRead("d2dupe.ini", "Coords", "botleftx", "Error")
        $y = IniRead("d2dupe.ini", "Coords", "botlefty", "Error")
    ElseIf $spot = 4 Then
        $x = IniRead("d2dupe.ini", "Coords", "botrightx", "Error")
        $y = IniRead("d2dupe.ini", "Coords", "botrighty", "Error")
    ElseIf $spot = 5 Then
        $x = IniRead("d2dupe.ini", "Coords", "centerx", "Error")
        $y = IniRead("d2dupe.ini", "Coords", "centery", "Error")
    EndIf
    
 ;Delays
    $delay1 = IniRead("d2dupe.ini", "delays", "maindelay", "Error")
    $skilldelay = IniRead("d2dupe.ini", "delays", "skilldelay", "Error")
HotKeySet($ek, "Terminate")
HotKeySet($pk, "pause")
HotKeySet($ik, "loadini")

EndFunc
Func iniload()
    Opt("GUIOnEventMode", 1)
    If BitAND(GUICtrlRead($radio1), $GUI_CHECKED) = $GUI_CHECKED Then
        IniWrite ( "d2dupe.ini", "other", "spottocast", "1" )
    ElseIf BitAND(GUICtrlRead($radio2), $GUI_CHECKED) = $GUI_CHECKED Then
        IniWrite ( "d2dupe.ini", "other", "spottocast", "2" )
    ElseIf BitAND(GUICtrlRead($radio3), $GUI_CHECKED) = $GUI_CHECKED Then
        IniWrite ( "d2dupe.ini", "other", "spottocast", "3" )
    ElseIf BitAND(GUICtrlRead($radio4), $GUI_CHECKED) = $GUI_CHECKED Then
        IniWrite ( "d2dupe.ini", "other", "spottocast", "4" )
    ElseIf BitAND(GUICtrlRead($radio5), $GUI_CHECKED) = $GUI_CHECKED Then
        IniWrite ( "d2dupe.ini", "other", "spottocast", "5" )
    EndIf
   ;Opt("GUIOnEventMode", 0)
    loadini()
EndFunc
Func Timer()
  _TicksToTime(Int(TimerDiff($timer)), $Hour, $Mins, $Secs )
  Local $sTime = $Time ; save current time to be able to test and avoid flicker..
  $Time = StringFormat("%02i:%02i:%02i", $Hour, $Mins, $Secs)
  If $sTime <> $Time Then ControlSetText("Timer", "", "Static1", $Time)
EndFunc
Func dupestart()
    While $dupe = 1
        MouseClick($mousekey, $x, $y, 1)
        sleep($skilldelay)
        If $dupe = 0 Then ExitLoop
        Sleep(10)
    WEnd
EndFunc
Func pause()
    If $dupe = 0 Then
        GUICtrlSetData ($button2,"Stop Duping")
        $dupe = 1
        Getready()
    Else
        GUICtrlSetData ($button2,"Start Duping")
        $dupe = 0
    EndIf
EndFunc
;Func _AdlibManager()
;   Local $aSplit = StringSplit(GUICtrlRead($iCTime), ':')
;   If $aSplit[0] >= 3 And (Int($aSplit[1]) >= _GetHour(@HOUR) _
;       Or Int($aSplit[2]) >= @MIN Or Int(StringTrimRight($aSplit[3], 3)) > @SEC) Then _
;       GUICtrlSetData($iCTime, 'Current Time' & @CRLF & _GetHour(@HOUR) & ':' & @MIN & ':' & @SEC & ' ' & $AMPM)
;   EndIf
;EndFunc



Func _GetHour($iHour)
    Switch $iHour
        Case 12
            $AMPM = 'PM'
            Return $iHour
        Case 13 To 23
            $AMPM = 'PM'
            Return $iHour - 12
        Case 0
            $AMPM = 'AM'
            Return 12
        Case 1 To 11
            $AMPM = 'AM'
            Return $iHour
    EndSwitch
EndFunc
Func _SwitchHour($iHour)
    Switch $iHour
        Case 12
            If $AMPM = 'AM' Then
                Return 0
            Else
                Return 12
            EndIf
        Case 1 To 11
            If $AMPM = 'PM' Then
                Return $iHour + 12
            Else
                Return $iHour
            EndIf
    EndSwitch
EndFunc
Func Terminate()
    Exit 0
EndFunc
Func HoldTime()
    $p = 2
    MsgBox(48, "", "Paused")
EndFunc
Func StartTime()
    MsgBox(48, "", "Started")
    $p = 1
EndFunc
func Getready()
    If WinActive($game) = 0 Then WinActivate($game)
    Sleep($delay1)
    WinMove($game, "", 0, 0, 800, 630)
    Sleep($delay1)
    MouseMove($x, $y, 2)
    Sleep($delay1)
    ControlSend($game, "", "", $skillkey)
    Sleep($delay1)
    dupestart()
EndFunc
Edited by Golbez
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...