Sign in to follow this  
Followers 0
Rorka

WoW Traveling

4 posts in this topic

Okay, well I know im new here, but I have been looking at the fourm for a few days and I have messed around with a few scripts for World of Warcraft, and I have come up with a small traveling bot, the only problem that I have is that it doesnt stop.

Can anybody help me here is my code:

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <File.au3>
#include <math.au3>
#include <NomadMemory.au3>

;Hotkeys
HotKeySet("{F10}","_StoreWp")
HotKeySet("{F11}","_Run")
HotKeySet("{Esc}","_Exit")

;Settings
Global $Waypoint_Offset = 10
Global $Cur_Waypoint = 1

$UPDATE = 0
Dim $PLAYERSPEED = 848
Dim $PTRPLAYER = 0x127F13C
Dim $STATEOFFSET = 2048
Dim $DIFFRENCEX2F = 47
Dim $PLAYERSPEED = 848
Dim $INTPLAYERXOFFSET = 2000
Dim $INTPLAYERYOFFSET = 2004
Dim $INTPLAYERZOFFSET = 2008
Global $SCALEOFFSET = 156
Global $PTRPLAYER, $PTRPLAYERX, $PTRPLAYERY, $PTRPLAYERZ, $SCALE, $PlayerMEM, $PLAYERNAME, $PLAYERSPEED
SETPRIVILEGE("SeDebugPrivilege", 1)
Dim $ProPID = WinGetProcess("World of Warcraft");--------FIX THIS---------@SW_MINIMIZE
$HPROCESS = _MemoryOpen($ProPID)


#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("WoW Traveler - "& "Not logged in" &" - Currenlty: Idle", 315, 360, -1, -1, -1,$WS_EX_TOPMOST + $WS_EX_TOOLWINDOW)
;Make The Cord list START
$ListView1 = GUICtrlCreateListView("X Cord|Y Cord|Z Cord", 0, 155, 315, 150)
GUICtrlSendMsg(-1, 0x101E, 0, 103)
GUICtrlSendMsg(-1, 0x101E, 1, 104)
GUICtrlSendMsg(-1, 0x101E, 2, 104)
$clear = GUICtrlCreateButton("Clear Cords", 8, 320, 75, 25, 0)
$Buttonload = GUICtrlCreateButton("Load Cords from file", 96, 335, 123, 25, 0)
$store = GUICtrlCreateButton("Store WP", 96, 308, 123, 25, 0)
;Make The Cord list END

$move = GUICtrlCreateButton("Travel!", 232, 320, 75, 25, 0) ; Start the bot
$scan = GUICtrlCreateButton("Click me first!", 0, 0, 315, 25, 0) ; Start the memory scanning

; Make Character information group and details START
$Group1 = GUICtrlCreateGroup("Character Information:", 0, 25, 329, 129)
$Label15 = GUICtrlCreateLabel("Name:", 8, 42, 35, 17)
$pname = GUICtrlCreateLabel("????????????", 44, 42, 100, 17)
$Label17 = GUICtrlCreateLabel("X Co-ordinate:", 8, 67, 71, 17)
$Label18 = GUICtrlCreateLabel("Y Co-ordinate:", 8, 87, 71, 17)
$Label19 = GUICtrlCreateLabel("Z Co-ordinate:", 8, 107, 71, 17)
$Label20 = GUICtrlCreateLabel("Character Size:", 8, 127, 76, 17)
$x = GUICtrlCreateLabel("X?", 80, 67, 100, 17)
$y = GUICtrlCreateLabel("Y?", 80, 87, 100, 17)
$z = GUICtrlCreateLabel("Z?", 80, 107, 100, 17)
$scaleval = GUICtrlCreateLabel("Scale?", 88, 127, 37, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
; Make Character information group and details END

GUISetState(@SW_SHOW) ; This makes the GUI visable

#EndRegion ### END Koda GUI section ###

$Time = TimerInit()
While 1 ;start the endless loop
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit ; Exit the bot
        Case $scan
            GetPointers() ;Start scanning function
        Case $move
            _Run()
        Case $store
            _StoreWp()
        Case $Buttonload
            _loadWP()
        Case $clear
            GUICtrlDelete($ListView1)
            $ListView1 = GUICtrlCreateListView("X Cord|Y Cord|Z Cord", 0, 155, 315, 150)
            GUICtrlSendMsg(-1, 0x101E, 0, 103)
            GUICtrlSendMsg(-1, 0x101E, 1, 104)
            GUICtrlSendMsg(-1, 0x101E, 2, 104)
    EndSwitch
    If $UPDATE = 1 Then
    UPDATE()
    EndIf
WEnd ; end the endless loop


Func GetPointers() ;Scans WoWs memory for cords
    Global $LVL1POINTER = _MemoryRead($PTRPLAYER, $HPROCESS, "ptr")
    Global $LVL2POINTER = _MemoryRead(($LVL1POINTER + 48), $HPROCESS, "ptr")
    Global $PlayerMEM = _MemoryRead(($LVL2POINTER + 40), $HPROCESS, "ptr")
    $PTRPLAYERX = $PlayerMEM + $INTPLAYERXOFFSET
    $PTRPLAYERY = $PlayerMEM + $INTPLAYERYOFFSET
    $PTRPLAYERZ = $PlayerMEM + $INTPLAYERZOFFSET
    $SCALE = $PlayerMEM + $SCALEOFFSET
    $ROTATE = $PlayerMEM + 0x7DC
    $GLIDEFLY = $PlayerMEM + 2112
    $PTRY = _MEMORYREAD($PTRPLAYERY, $HPROCESS, "float")
    $PLAYERNAME = _MEMORYREAD(0x11cb348, $HPROCESS, "char[12]")
    GUICtrlSetData($pname, $PLAYERNAME)
    WinSetTitle($Form1, "", "WoW Traveler - "& $PLAYERNAME &" - Currenlty: Idle")
    $UPDATE = 1
EndFunc  ;==>GetPointers


Func UPDATE() ; update the cords
    $CURXPOS1 = GUICtrlSetData($X, _MEMORYREAD($PTRPLAYERX, $HPROCESS, "float"))
    $CURYPOS2 = GUICtrlSetData($Y, _MEMORYREAD($PTRPLAYERY, $HPROCESS, "float"))
    $CURZPOS3 = GUICtrlSetData($Z, _MEMORYREAD($PTRPLAYERZ, $HPROCESS, "float"))
    GUICtrlSetData($scaleval, _MEMORYREAD($SCALE, $HPROCESS, "float"))
EndFunc

Func _GetCoords()
    Local $Array[3]
    
    
    $Array[0] = Floor(_MEMORYREAD($PTRPLAYERX, $HPROCESS, "float")) ;x
    If @error Then
        MsgBox(4096, "ERROR", "Failed to read memory.")
        Exit
    EndIf
    
    $Array[1] = Floor( _MEMORYREAD($PTRPLAYERZ, $HPROCESS, "float")) ;y
    If @error Then
        MsgBox(4096, "ERROR", "Failed to read memory.")
        Exit
    EndIf
    
    $Array[2] = Floor(_MEMORYREAD($SCALE, $HPROCESS, "float"));z
    If @error Then
        MsgBox(4096, "ERROR", "Failed to read memory.")
        Exit
    EndIf
    
    Return $Array
EndFunc

Func _StoreWp()
    Local $s_Coords = _GetCoords()
    FileWriteLine("Data\User data\Waypoints\Waypoint.data", $s_Coords[0] & "|" & $s_Coords[1] & "|" & $s_Coords[2])
    $ListView1_0= GUICtrlCreateListViewItem($s_Coords[0] & "|" & $s_Coords[1] & "|" & $s_Coords[2], $ListView1)
EndFunc

Func _loadWP()
    $file = FileOpenDialog("Select the waypoint file",  @ScriptDir , "Data Files (*.Data)", 1 + 4 )
    For $x = 1 To _FileCountLines($file)
    GUICtrlCreateListViewItem(FileReadLine($file, $x), $ListView1)
Next
EndFunc

Func _Run()     
    WinSetTitle($Form1, "", "WoW Traveler - "& $PLAYERNAME &" - Currenlty: Running")

While 1
    Local $Waypoint = FileReadLine("Data\User data\Waypoints\Waypoint.data",$Cur_Waypoint)
    $Waypoint = StringSplit($Waypoint, "|")
        $Cur_Coords = _GetCoords()
        If _closeby($Cur_Coords[0], $Waypoint[1], $Waypoint_Offset) Then  
            If _closeby($Cur_Coords[1], $Waypoint[2], $Waypoint_Offset) Then
                ExitLoop
            EndIf
        EndIf
        
    Local $s_Coords = _GetCoords()
    If GUICtrlRead($x) = $s_Coords[0] Then
        If GUICtrlRead($y) = $s_Coords[1] Then
            If GUICtrlRead($z) = $s_Coords[2] Then
                ExitLoop
            EndIf
        EndIf
    EndIf
    Send("{w down}")
    Sleep(Random(500,1000))
    Send("{W up}")
WEnd

EndFunc


Func _closeby($s_Num1,$s_Num2, $s_Range)
    If $s_Num1 > $s_Num2- $s_Range Then
        If $s_Num1 < $s_Num2 + $s_Range Then
            Return 1
        EndIf
    EndIf
    
    Return 0
EndFunc


Func _Exit() ; Exit the bot
WinSetTitle($Form1, "", "WoW Traveler - Currenlty: Closing down")
Sleep(Random(100,2000))
Exit
EndFunc

Here is the file Zipped that contains everthing else that you need

Travel.zip

Share this post


Link to post
Share on other sites



28 views, not 1 reply :P

Share this post


Link to post
Share on other sites

Have you tried putting in a stop co-ordanate, you have said where to go but not where to stop, try that!!!

Share this post


Link to post
Share on other sites

Have you tried putting in a stop co-ordanate, you have said where to go but not where to stop, try that!!!

Erm...

Well it should stop at the last co-ordanate, so it should'nt need a stop co-ordanate.

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  
Followers 0