Register for your free account! | Forgot your password?

Go Back   elitepvpers > World of Warcraft > WoW Bots
You last visited: Today at 16:59

  • Please register to post and access all features, it's quick, easy and FREE!

 

Autoit waypoint Bot

Reply
 
Old   #1
 
elite*gold: 220
Join Date: Jun 2007
Posts: 3,764
Received Thanks: 1,114
Autoit waypoint Bot

brauche hilfe habe sonen travel bot habe ihn selber etwas umgeschrieben, also zb. er läuft die waypoints so ab er steht zb. auf 1550(Y),-525(X) und er muss eigentlich 1551(Y), -525(X) dann überprüft der das so und dann dreht er sich und will auf die richtigen coordinaten laufen und er läuft dann immer drüber und dann dauert das bis er weiter läuft wollte fragen wie man das überprüfen in dem code rausnimmt oder macht das wenn er 2 - 3 oder so höher oder niedriger auf der X und Y achse ist das er dann weiter läuft, also das er das net so ganz genau macht.

Quote:
#AutoIt3Wrapper_icon=lol.ico
;Includes
#include <GUIConstants.au3>
#include <String.au3>
#include <Date.au3>
#include <array.au3>
#include <Math.au3>
#include <File.au3>
#include <_XMLDomWrapper.au3>
#include <NomadMemory.au3>
#include <File.au3>
;Hotkeys
HotkeySet("{ESC}","terminate")
HotkeySet("{F1}","RunTheBot")
;hotkeyset("{F3}","Pause") - Implant soon...

hotkeyset("{F2}","SaveDestination_Ghost")

;;================================================ ================================
;;Variable Definition;
;;================================================ ================================
;;App
$App_name = "Auto-Travel" ;Main Name of the application
$App_version = "" ;Version Number of the Application
$App_Title = ($App_name & " " & $App_version & " ") ;Final Name of Process

;Files
Global $WowProcessName = "World of Warcraft" ;Name of the process (CASE SENSITIVE!!! FIX FOR YOUR VERSION)
Global $logname = "/Progress.log" ;Name of the logfile

;; Usual Config
dim $RatioConvertion = "100"
dim $slowdistance = "1"
dim $TimeBeforeJump = "4000" ;ms before starting to jump over a obstecle
dim $TimeBeforeReverse = "10000" ;ms before going back to previous waypoint
dim $walkkey = "{NUMLOCK}" ;Not used

;others
Global $wait, $running, $MouseDown, $taskset,$rot_perfect = 0 ;MouseDown is 1 when the mouse is down, and 0 when not
dim $cmdtabel = 0 ;When running the bot it will automaticly go to the first CASE in the CMDTable
Global $CurrentCheck = 1 ;Is 1 when its first time a check is being made
Dim $dubblecheckPos
dim $Overllrot, $OverllLocX, $OverllLocY, $OverllZone, $CurrentRot, $CurrentLocX, $CurrentLocY, $continentID, $lastX, $lastY, $debug, $toposX,$toposY,$result = 0
dim $dubblecheckPos, $ycheck, $slow, $move_x_big, $move_y_big, $rot_perfect, $rot_fast, $down, $XCurBigger, $YCurBigger, $jtdif, $jtstart = 0
dim $checkagain = 0
global $arraynumber = "0"
dim $array_x_number = "0"
global $pi = 4 * ATan(1)
dim $Xstart, $Ystart = 0
Global $pasedborder = 0
dim $jumptimerwalk, $deathNY = 0
$alive = 1
;for XML Process
Global $xmlFile ;Name of the XML File open
dim $test_pause = 0
$ATTRIBS = _ArrayCreate ("Continent","Zone","Nr","posX","posY","Comment ")
$CHILDATTRIBS = _ArrayCreate ("Continent","Zone","Nr","posX","posY","Comment ")
Global $xmlFile
Global $count = 0
Global $sNxPath, $fHwnd
Global $ARRAY[1][1]
Global $ARRAYX
Global $ARRAYY
Local $additional = 1
Local $numb = 0001
dim $corpselocX,$releasecorpse, $corpselocY = 0
;for XML Process __ for save waypoint
Local $szXPath1,$szXPath2, $aNodeName1,$aNodeName2, $find, $oXSD,$iNodeCount,$aAttrName1[1],$aAttrVal1[1],$aAttrName2[1],$aAttrVal2[1],$ret_val,$X
Opt("WinTitleMatchMode", 4)
Global $ProcessID = WinGetProcess($WowProcessName,"")
SetPrivilege("SeDebugPrivilege", 1)
If $ProcessID = -1 Then
MsgBox(4096, "Thermo Prime - ERROR", "Failed to detect World of Warcraft running.")
Exit
EndIf
_FileWriteLog(@ScriptDir & $logname,":::Start Of Session:::")
;;================================================ ================================
;;GUI;
;;================================================ ================================

;Window
GUICreate($App_Title, 200, 250)
GUISetState (@SW_SHOW)

;Buttons
$Button_SelectProfile = GUICtrlCreateButton ("Select Profile", 100, 10, 100)
$Button_NewProfile = GUICtrlCreateButton ("New Profile", 100, 40, 100)
GUICtrlCreateLabel("F1 Run Waypoints", 100, 70, 100)
GUICtrlCreateLabel("F2 Save Waypoints", 100, 90, 100)


;Labels
$FinalCharname = GUICtrlCreateLabel("Acc.Name", 10,10,70,20,($SS_SUNKEN ))
$Finallocx = GUICtrlCreateLabel("Position X", 10,40,70,20,($SS_SUNKEN ))
$Finallocy = GUICtrlCreateLabel("Position Y", 10,70,70,20,($SS_SUNKEN ))
$Finalrot = GUICtrlCreateLabel("Rotation", 10,100,70,20,($SS_SUNKEN ))
$Finalrandom = GUICtrlCreateLabel("ZoneID", 10,130,70,20,($SS_SUNKEN ))
;Labels_debug
$DebugID = GUICtrlCreateLabel("StatusID", 5,210,120,20,($SS_SUNKEN ))
$RotationID = GUICtrlCreateLabel("RotationID", 5,190,120,20,($SS_SUNKEN ))

;Checkbox
$debugcheck = GUICtrlCreateCheckbox ("Debug Mode", 5, 230, 160, 20)
$combatmode = GUICtrlCreateCheckbox ("Combat Mode", 100, 230, 160, 20)
;WinSetOnTop($App_Title, "", 1) - Implant soon...

SmartBehavior()

;;================================================ ================================
;;THERMO START!
;;================================================ ================================





Func SmartBehavior()
While $wait = 0
;Check GUI for userinput
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
Exit 0
Case $msg = $Button_SelectProfile
SelectOpenXML()
Case $msg = $Button_NewProfile
NewProfile()
EndSelect
;Check if wow is running
If WinActive("World of Warcraft") Then
If $xmlFile = "" Then
sleep(10)
msgbox(0,"Thermo Prime - ERROR","You have not selected a XML File! Please press the [Select Profile] button and select a profile before running")
WinWaitActive($App_Title)
Else
_FileWriteLog(@ScriptDir & $logname,"World Of Warcraft process opned")
sleep(20)
send("{Enter}")
sleep(11)
Clipput("/script DEFAULT_CHAT_FRAME:AddMessage("""& $app_name & "" & $App_version & " is running!! "",0.0,0.0,1.0); ")
sleep(11)
Send("^v")
sleep(11)
send("{Enter}")
$wait = 1
EndIf
EndIf
WEnd
;Start the bot-----------------
While 1
Cmdtable()
WEnd
EndFunc ;==>SmartBehavior

;;================================================ ================================
;;Command Table;
;;================================================ ================================
func Cmdtable() ;;Command Table for functions, this table can be used for configuring the steps of the bots behaviour
$debug = GUICtrlRead($debugcheck)
Switch $cmdtabel
Case 0
;ControlSetText($App_Title, "", $DebugID, "0-GetCurrentData")
GetCurrentData()
Case 1
ControlSetText($App_Title, "", $DebugID, "1-EventCalculation" & $array_x_number) ;these are for debuggin - Remove soon...
EventCalculation()
Case 2
ControlSetText($App_Title, "", $DebugID, "2-CheckRotation")
_FileWriteLog(@ScriptDir & $logname,"checkRotation" & $taskset)
CheckRotation()
Case 3
ControlSetText($App_Title, "", $DebugID, "3-GoToPos")
_FileWriteLog(@ScriptDir & $logname,"Gotopos")
GoToPos()
Case 4
ControlSetText($App_Title, "", $DebugID, "4-Dubblecheck")
_FileWriteLog(@ScriptDir & $logname,"dualchecl")
Dubblecheck()
Case 5
ControlSetText($App_Title, "", $DebugID, "5-runbot")
_FileWriteLog(@ScriptDir & $logname,"runbot")
runbot()
EndSwitch
Return
Endfunc ;==>Cmdtable

;;================================================ ================================
;;GetCurrentData;
;;================================================ ================================
Func GetCurrentData() ;Read data from memory
if $CurrentCheck = 1 Then
MemoryLoop()
EndIf
if $dubblecheckPos = 1 Then
$cmdtabel = 4;Next step = 4 Dubblecheck()
Return
Else
$cmdtabel = 1 ;Next step = EvenCalculation()
Return
EndIf
EndFunc ;==>GetCurrentData

;;================================================ ================================
;;EvenCalculation;
;;================================================ ================================
Func EventCalculation();With the info from GetCurrentData calculate what to do
if $deathNY = 0 Then
if $alive = 1 Then
$alive = 0
$corpselocX = $CurrentLocX
$corpselocY = $CurrentLocY

EndIf
EndIf
if $running = "1" Then
if $CurrentLocX = $toposX Then
if $CurrentLocY = $toposY Then
$running = "0"
$checkagain = 0
$dubblecheckPos = 0
$cmdtable = 5
$rot_perfect = 0
Return ;Next step = GetCurrentData()
EndIf
EndIf
;$cmdtable = 5
;$rot_perfect = 0
;Return ;Next step = GetCurrentData()
EndIf

if $pasedborder = 1 Then
$running = "0"
$checkagain = 0
$dubblecheckPos = 0
$cmdtable = 5
$rot_perfect = 0
Return ;Next step = GetCurrentData()
EndIf

if $taskset = 1 Then
_FileWriteLog(@ScriptDir & $logname,"Data recived from game; Rotation=" & $CurrentRot & ". PositionX=" & $CurrentLocX & ". PositionY=" & $CurrentLocY & "." )
$cmdtabel = 2 ;Next step = CheckRotation()
Return
EndIf
if $rot_perfect = 1 Then
$cmdtabel = 3 ;Next step = GoToPos()
Return
EndIf
$cmdtabel = 0 ;Next step = GetCurrentData()
return
EndFunc ;==>EventCalculation

;;================================================ ================================
;;CheckRotation
;;================================================ ================================
Func CheckRotation()
if $debug = 1 then
send("{Enter}")
sleep(200)
Clipput("Current = " & $CurrentRot & " result= " & $result)
Send("^v")
sleep(200)
send("{Enter}")
EndIf
$jtstart = "0"
$jumptimerwalk = "0"
$lastX = "0"
$lastY = "0"
$windowsize = WinGetPos($WowProcessName)
MouseMove((($windowsize[2]/2)+$windowsize[0]),(($windowsize[3]/2)+$windowsize[1]), 0)
while $taskset = 1
MemoryLoop()
Rotationfix()
$Rot_Smallest = _Min($CurrentRot, $result)
$Rot_Biggest = _Max($CurrentRot, $result)
if $CurrentRot = $Rot_Biggest Then
If ($CurrentRot - $result) < 190 Then
$down = 1
if ($CurrentRot - $result) < 50 Then
$rot_fast = 0
if ($CurrentRot - $result) < 9 Then
$rot_fast = 2
EndIf
else
$rot_fast = 1
EndIf
Else
$down = 0
if (($result + 360) - $CurrentRot) < 50 Then
$rot_fast = 0
if (($result + 360) - $CurrentRot) < 9 Then
$rot_fast = 2
EndIf
else
$rot_fast = 1
EndIf
EndIf
Else
If ($result - $CurrentRot) < 190 Then
$down = 0
if ($result - $CurrentRot) < 50 Then
$rot_fast = 0
if ($result - $CurrentRot) < 9 Then
$rot_fast = 2
EndIf
else
$rot_fast = 1
EndIf
else
$down = 1
if (($CurrentRot + 360) - $result) < 50 Then
$rot_fast = 0
if (($CurrentRot + 360) - $result) < 9 Then
$rot_fast = 2
EndIf
else
$rot_fast = 1
EndIf
EndIf
EndIf

if $CurrentLocX = $toposX Then
if $CurrentLocY = $toposY Then
$cmdtabel = 5 ;Next step = GetCurrentData()
$rot_perfect = 1
$taskset = 0

Return ;Next step = GetCurrentData()
EndIf
EndIf
MouseDown("right")


if $rot_fast = 1 Then
if $down = 0 Then
;MouseDown("right")
_MouseMovePlus(-20,0)
Sleep(10)
Else
;MouseDown("right")
_MouseMovePlus(20,0)
Sleep(10)
EndIf
EndIf
if $rot_fast = 0 Then
if $down = 0 Then
MouseDown("right")
_MouseMovePlus(-10,0)
Sleep(10)
;sleep(200)
Else
;MouseDown("right")
_MouseMovePlus(10,0)
Sleep(10)
EndIf
EndIf
if $rot_fast = 2 Then
if $down = 0 Then
;MouseDown("right")
_MouseMovePlus(-2,0)
Sleep(10)
;sleep(200)
Else
;MouseDown("right")
_MouseMovePlus(2,0)
Sleep(10)
EndIf
EndIf
;Update Rotation Data
MemoryLoop()
Rotationfix()
if floor($CurrentRot) = floor($result) Then
MouseUp("right")
$taskset = 0
sleep(200)
EndIf
wend
_FileWriteLog(@ScriptDir & $logname,"Rotation Complete; CurrentRotation=" & $CurrentRot & ". FinalRotation=" & $result & "." )
MouseUp("right")
$cmdtabel = 0 ;Next step = GetCurrentData()
$rot_perfect = 1
$taskset = 0
return
EndFunc ;==>CheckRotation

;;================================================ ================================
;;GoToPos
;;================================================ ================================
Func GoToPos()

; [Find The Coordinate Place]
If $toposX <= $Xstart Then
$XCurBigger = 1
Else
$XCurBigger = 0
EndIf
If $toposY <= $Ystart Then
$YCurBigger = 1
Else
$YCurBigger = 0
EndIf
$distance = _max(($CurrentLocX+$CurrentLocy),($toposX+$toposY) ) - _min(($CurrentLocX+$CurrentLocy),($toposX+$toposY) )
; [/Find The Coordinate Place]
send ("{w down}")
while $rot_perfect = 1


;For Jump Timer
$lastX = $CurrentLocX
$lastY = $CurrentLocY
; [Gather Position Data From WoW]
MemoryLoop()

;[Tjek Data]
;Jump Timer (if the player stays too long at the same location it will start jumping, and short after return to previous waypoint.)
If $lastX = $CurrentLocX Then
If $lastY = $CurrentLocY Then
if $jtstart = 0 Then
$jumptimerwalk = TimerInit()
$jtstart = 1
EndIf
$jtdif = TimerDiff($jumptimerwalk)
ControlSetText($App_Title, "", $RotationID, "TimerLoc:" & $lastX &","&$lastY & " t:" & floor($jtdif) )
If $jtdif > $TimeBeforeReverse Then ;For Going Back One Step in the Waypoint Section
if $deathNY = 0 Then
if $alive = 1 Then
$alive = 0
$corpselocX = $CurrentLocX
$corpselocY = $CurrentLocY

EndIf
EndIf
_FileWriteLog(@ScriptDir & $logname,"Could not reach the desired destination; waypoint: " & $array_x_number & ", retrying from last waypoint. RP=" & $jtdif)
$array_x_number = $array_x_number - 1
$cmdtabel = 5 ;Next step = Save_f()
$jtstart = 0
;send ("{w down}")
send ("{w}")
Return
EndIf
if $jtdif > $TimeBeforeJump Then ;For Basic Jump after X Secounds
_FileWriteLog(@ScriptDir & $logname,"Suspected stuck trying to reach; waypoint: " & $array_x_number & ", attempting jump procedure. RP=" & $jtdif)
send ("{w up}")
sleep(20)
send("{space}")
sleep(100)
send ("{w down}")
EndIf
Else
$jumptimerwalk = 0
$jtstart = 0
$jtdif = 0
EndIf
Else
$jumptimerwalk = 0
$jtstart = 0
$jtdif = 0
EndIf
;[Tjek Data]


if _max(($CurrentLocX+$CurrentLocy),($toposX+$toposY) ) - _min(($CurrentLocX+$CurrentLocy),($toposX+$toposY) ) > $distance Then
$cmdtabel = 0 ;Next step = Save_test()
send ("{w}")
$dubblecheckPos = 1
$cmdtable = 0
$rot_perfect = 0
$pasedborder = 1
Return
EndIf

if $XCurBigger = 0 Then
If $CurrentLocX >= $toposX Then
;send ("{w down}")
$dubblecheckPos = 1
$cmdtable = 0
$rot_perfect = 0
$pasedborder = 1
Return ;Next step = GetCurrentData()
EndIf
EndIf


If $XCurBigger = 1 Then
if $CurrentLocX <= $toposX Then
if $YCurBigger = 1 Then
if $CurrentLocY <= $toposY Then
;send ("{w down}")
$dubblecheckPos = 1
$cmdtable = 0
$rot_perfect = 0
$pasedborder = 1
Return ;Next step = GetCurrentData()
EndIf
EndIf
If $YCurBigger = 0 Then
if $CurrentLocY >= $toposY Then
;send ("{w down}")
$dubblecheckPos = 1
$cmdtable = 0
$rot_perfect = 0
$pasedborder = 1
Return ;Next step = GetCurrentData()
EndIf
EndIf
EndIf
EndIf


If $YCurBigger = 0 Then
if $CurrentLocY >= $toposY Then
;send ("{w down}")
$dubblecheckPos = 1
$cmdtable = 0
$rot_perfect = 0
$pasedborder = 1
Return ;Next step = GetCurrentData()
EndIf
EndIf

if $YCurBigger = 1 Then
if $CurrentLocY <= $toposY Then
if $XCurBigger = 0 Then
If $CurrentLocX >= $toposX Then
;send ("{w down}")
$dubblecheckPos = 1
$cmdtable = 0
$rot_perfect = 0
$pasedborder = 1
Return ;Next step = GetCurrentData()
EndIf
EndIf
If $XCurBigger = 1 Then
if $CurrentLocX <= $toposX Then
;send ("{w down}")
$dubblecheckPos = 1
$cmdtable = 0
$rot_perfect = 0
$pasedborder = 1
Return ;Next step = GetCurrentData()
EndIf
EndIf
EndIf
EndIf





ControlSetText($App_Title, "", $DebugID, "3-GoToPos:" & $toposX &","&$toposy)
WEnd
if $debug = 1 then
send("{Enter}")
sleep(200)
Clipput("Error")
Send("^v")
sleep(200)
send("{Enter}")
EndIf
;send ("{w up}")
$cmdtabel = 0 ;Next step = GetCurrentData()
return
EndFunc ;==>GoToPos

;;================================================ ================================
;;Dubblecheck()
;;================================================ ================================
Func Dubblecheck()

if $CurrentLocX <= ($toposX+6) And $CurrentLocX >= ($toposX-6) Then
if $CurrentLocY <= ($toposY+6) And $CurrentLocY >= ($toposY-6) Then

$dubblecheckPos = 0
$taskset = 0
$rot_perfect = 0
$cmdtabel = 0

;send("{´}")
$slow = 0
if ($ARRAY[4][($ARRAYY-$arraynumber)+0]) = $arraynumber Then
$checkagain = 1
msgbox(0,"error","error")
Return
Else
$cmdtabel = 5
$checkagain = 0
_FileWriteLog(@ScriptDir & $logname,"Succes Reaching waypoint: " & $array_x_number & " check" & $CurrentLocX & "=" & $toposX & " . " & $CurrentLocY & "=" & $toposY)
if $deathNY = 0 Then
if $releasecorpse = 1 Then


sleep(1)

$alive = 1
EndIf
EndIf
Return
EndIf
EndIf
EndIf
$checkagain = 1
$dubblecheckPos = 0
$cmdtabel = 5 ;Next step = EvenCalculation()
send ("{w up}")
Return

EndFunc ;==>Dubblecheck

;;================================================ ================================
;;Runbot;
;;================================================ ================================
func RunBot()
;msgbox(0,"LOL",$toposX & " " & $toposY & " <- " & $CurrentLocX & " " & $CurrentLocY)
$running = "1"


if $checkagain = 0 Then
;;For repeat (if the current number goes beyond the last array it will set to 1)
if $deathNY = 1 Then
if ($array_x_number) = ($ARRAYY) Then
$array_x_number = 0
Return
EndIf
EndIf
$array_x_number = $array_x_number + 1
EndIf

if $deathNY = 0 Then
if ($array_x_number) = ($ARRAYY) Then

sleep(1)

if $deathNY = 1 Then
$alive = 1
$array_x_number = 0
Else
$posx2 = $CurrentLocX
$posy2 = (($CurrentLocY/"100")*$RatioConvertion )
$toposX = $corpselocX
$toposY = $corpselocY
$posx1 = $corpselocX
$posy1 = (($corpselocY/"100")*$RatioConvertion )
$releasecorpse = 1
$radToDeg = -180 / $pi
$result = atan(($posy1-$posy2)/($posx2-$posx1)) * $radToDeg
if $posx2 < $posx1 Then
if $result < 0 Then
$result = 270 + $result
Else
$result = 270 + $result
EndIf
EndIf
if $posx2 >= $posx1 Then
if $result < 0 Then
$result = 90 + $result
Else
$result = 90 + $result
EndIf
EndIf
$result = $result-360
$result = floor(($result - $result) - $result)
if $result = "360" Then $result = 0
$cmdtabel = 0
$taskset = 1
$pasedborder = 0
$cmdtable = 1
EndIf
send("{F1}")
Return ;Next step = GetCurrentData()
EndIf
EndIf





;; If the Current number is 0 it will go to the last waypoint to make it backwoards compatible.
if $array_x_number = 0 Then
$array_x_number = $ARRAYY
EndIf

_FileWriteLog(@ScriptDir & $logname,"Processing Destination Waypoint; " & $array_x_number & "." )
if $debug = 1 then
send("{Enter}")
sleep(200)
Clipput("1 = " & $array_x_number)
sleep(20)
Send("^v")
sleep(200)
send("{Enter}")
EndIf



if $deathNY = 1 Then
$szXPath1 = "//DATAPACKET/METADATA/FIELDS"
$szXPath2 = "//DATAPACKET/ROWDATA"
Else
$szXPath1 = "//DATAPACKET/METADATA/FIELDS"
$szXPath2 = "//DATAPACKET/ROWGHOST"
Secureghost()
;$array_x_number = 0
EndIf
;; If the Current number is 0 it will go to the last waypoint to make it backwoards compatible.
;if $array_x_number = 0 Then
; $array_x_number = $ARRAYY
; EndIf
ReDim $ARRAY[$ARRAYX][$ARRAYY+1]
;TrayTip("Position Manager", $ARRAYY & " Nodes Loaded...", 5, 1)
$aNodeName1 = _XMLGetChildNodes ($szXPath1)
$aNodeName2 = _XMLGetChildNodes ($szXPath2)
If $aNodeName1 <> -1 Then
;LOOP THROUGH //DATAPACKET/METADATA/FIELDS
For $find = 1 To $aNodeName1[0]
_XMLGetAllAttrib($szXPath1 & "/*" & '[' & $find & ']',$aAttrName1,$aAttrVal1)
;ADD TO ARRAY
$ARRAY[$find-1][0] = $aAttrVal1[0]
;LOOP THROUGH //DATAPACKET/ROWDATA
For $X=1 To $aNodeName2[0]
_XMLGetAllAttrib($szXPath2 & "/*" & '[' & $X & ']',$aAttrName2,$aAttrVal2)
;ONLY APPEND IF CURRENT FIELD NIMBER IS LESS THAN NUMBER OF ATTRIBS FOUND IN EACH ROW
If $find <= Ubound($aAttrName2) Then
;msgbox(0,"hej",$find & " X= " & $X & " att " &$aNodeName2[0] & " AN= " & $aNodeName1[0] & " " & $aAttrVal2[$find-1])
Secureghost()
$ARRAY[$find-1][$X] = $aAttrVal2[$find-1]

EndIf
Next
Next
Else
MsgBox(0, "Error:", "No nodes found for " & $szXPath1)
EndIf

;if $array_x_number = ($ARRAYY+1) Then
; $array_x_number = $array_x_number - 1
; EndIf

$posx2 = $CurrentLocX
$posy2 = (($CurrentLocY/"100")*$RatioConvertion )
$posx1 = $ARRAY[3][$array_x_number]
$posy1 = ((($ARRAY[4][$array_x_number])/"100")*$RatioConvertion )
$toposX = $ARRAY[3][$array_x_number]
$toposY = $ARRAY[4][$array_x_number]
$checkagain = 1


;if $deathNY = 0 Then
; if ($array_x_number+1) = ($ARRAYY) Then
; $toposX = $corpselocX
; $toposY = $corpselocY
; $posx1 = $corpselocX
; $posy1 = (($corpselocY/"100")*$RatioConvertion )
; $releasecorpse = 1
; msgbox(0,"test",$corpselocX & " " & $corpselocY)
; EndIf
;EndIf

;msgbox(0,"hej","$posx1=" & $posx1 & " " & "$posy1=" & $posy1 & " " & "$posx2=" &$posx2 & " " & "$posy2=" & $posy2 & " " & "$toposX=" &$toposX & " " & "$toposY=" & $toposY)
_FileWriteLog(@ScriptDir & $logname,"Data From XML - " & $array_x_number & ". Destination pos: " & $toposX & "." & $toposY)
if $debug = 1 then
send("{Enter}")
sleep(200)
Clipput("1 = " & $ARRAY[3][1] & " 2 = " & $ARRAY[4][1] & " 3 =" & $array_x_number)
sleep(20)
Send("^v")
sleep(200)
send("{Enter}")
EndIf
$radToDeg = -180 / $pi
$result = atan(($posy1-$posy2)/($posx2-$posx1)) * $radToDeg
if $posx2 < $posx1 Then
if $result < 0 Then
$result = 270 + $result
Else
$result = 270 + $result
EndIf
EndIf
if $posx2 >= $posx1 Then
if $result < 0 Then
$result = 90 + $result
Else
$result = 90 + $result
EndIf
EndIf
$result = $result-360
$result = floor(($result - $result) - $result)
if $result = "360" Then $result = 0
$cmdtabel = 0
$taskset = 1
if $debug = 1 then
send("{Enter}")
sleep(200)
Clipput("Current position = " & $CurrentLocX & "," & $CurrentLocY & " End Position = " & $toposX & "," & $toposY & " rotation calculated = " & $result)
sleep(20)
Send("^v")
sleep(200)
send("{Enter}")
EndIf

$pasedborder = 0
$cmdtable = 1
Return ;Next step = GetCurrentData()
EndFunc ;==>Runbot;

;;================================================ ================================
;;Runbot1;
;;================================================ ================================
func RunTheBot()
if $test_pause = 0 Then
$oXSD = _XMLFileOpen ($xmlFile, "")
;If @error Or $oXSD < 1 Then
; MsgBox(0, "Error", "There was an error opening the file " & $xmlFile)
; $oXSD = 0
; _FileWriteLog(@ScriptDir & $logname,"Error Opning XMLFile - Ending Session")
; _FileWriteLog(@ScriptDir & $logname,":::End Of Session:::")
; Exit
;EndIf

if $deathny = 1 Then
$szXPath1 = "//DATAPACKET/METADATA/FIELDS"
$szXPath2 = "//DATAPACKET/ROWDATA"
Else
$szXPath1 = "//DATAPACKET/METADATA/FIELDS"
$szXPath2 = "//DATAPACKET/ROWGHOST"
$array_x_number = 0
EndIf

$ARRAYX = _XMLGetNodeCount($szXPath1 & "/*")
$ARRAYY = _XMLGetNodeCount($szXPath2 & "/*")
$additional = $ARRAYY
;ReDim $ARRAY[$ARRAYX][$ARRAYY+1]
if $ARRAYY < 0 Then $ARRAYY = 0
TrayTip("Position Manager", $ARRAYY & " Nodes Loaded...", 5, 1)
$aNodeName1 = _XMLGetChildNodes ($szXPath1)
$aNodeName2 = _XMLGetChildNodes ($szXPath2)
If $aNodeName1 <> -1 Then
;LOOP THROUGH //DATAPACKET/METADATA/FIELDS
For $find = 1 To $aNodeName1[0]
_XMLGetAllAttrib($szXPath1 & "/*" & '[' & $find & ']',$aAttrName1,$aAttrVal1)
;ADD TO ARRAY
;$ARRAY[$find-1][0] = $aAttrVal1[0]
;LOOP THROUGH //DATAPACKET/ROWDATA
;For $X=1 To $aNodeName2[0]
; _XMLGetAllAttrib($szXPath2 & "/*" & '[' & $X & ']',$aAttrName2,$aAttrVal2)
; ;ONLY APPEND IF CURRENT FIELD NIMBER IS LESS THAN NUMBER OF ATTRIBS FOUND IN EACH ROW
; If $find <= Ubound($aAttrName2) Then
; $ARRAY[$find-1][$X] = $aAttrVal2[$find-1]
; EndIf
;Next
Next
Else
MsgBox(0, "Error:", "No nodes found for " & $szXPath1)
EndIf
;$arraynumber = ($ARRAY[2][$ARRAYY])
$array_x_number = 0;$arraynumber


$oXSD = 0
EndIf
RunBot()
EndFunc

;;================================================ ================================
;;Secure Ghost
;;================================================ ================================
func Secureghost()
if $test_pause = 0 Then
$oXSD = _XMLFileOpen ($xmlFile, "")
;If @error Or $oXSD < 1 Then
; MsgBox(0, "Error", "There was an error opening the file " & $xmlFile)
; $oXSD = 0
; _FileWriteLog(@ScriptDir & $logname,"Error Opning XMLFile - Ending Session")
; _FileWriteLog(@ScriptDir & $logname,":::End Of Session:::")
; Exit
;EndIf

if $deathny = 1 Then
$szXPath1 = "//DATAPACKET/METADATA/FIELDS"
$szXPath2 = "//DATAPACKET/ROWDATA"
Else
$szXPath1 = "//DATAPACKET/METADATA/FIELDS"
$szXPath2 = "//DATAPACKET/ROWGHOST"
EndIf

$ARRAYX = _XMLGetNodeCount($szXPath1 & "/*")
$ARRAYY = _XMLGetNodeCount($szXPath2 & "/*")
$additional = $ARRAYY
;ReDim $ARRAY[$ARRAYX][$ARRAYY+1]
if $ARRAYY < 0 Then $ARRAYY = 0
TrayTip("Position Manager", $ARRAYY & " Nodes Loaded...", 5, 1)
$aNodeName1 = _XMLGetChildNodes ($szXPath1)
$aNodeName2 = _XMLGetChildNodes ($szXPath2)
If $aNodeName1 <> -1 Then
;LOOP THROUGH //DATAPACKET/METADATA/FIELDS
For $find = 1 To $aNodeName1[0]
_XMLGetAllAttrib($szXPath1 & "/*" & '[' & $find & ']',$aAttrName1,$aAttrVal1)
;ADD TO ARRAY
;$ARRAY[$find-1][0] = $aAttrVal1[0]
;LOOP THROUGH //DATAPACKET/ROWDATA
;For $X=1 To $aNodeName2[0]
; _XMLGetAllAttrib($szXPath2 & "/*" & '[' & $X & ']',$aAttrName2,$aAttrVal2)
; ;ONLY APPEND IF CURRENT FIELD NIMBER IS LESS THAN NUMBER OF ATTRIBS FOUND IN EACH ROW
; If $find <= Ubound($aAttrName2) Then
; $ARRAY[$find-1][$X] = $aAttrVal2[$find-1]
; EndIf
;Next
Next
Else
MsgBox(0, "Error:", "No nodes found for " & $szXPath1)
EndIf
;$arraynumber = ($ARRAY[2][$ARRAYY])



$oXSD = 0
EndIf
Return
EndFunc


;;================================================ ================================
;;MemoryLoop;
;;================================================ ================================
func MemoryLoop()

;Check if memory is accesible
Local $DllInformation = _MemoryOpen($ProcessID)
If @Error Then
MsgBox(4096, "ERROR", "Failed to open memory.")
Exit
EndIf
$CurrentCharname = _MemoryRead(0x00BD97B0, $DllInformation, 'char[11]')
If @Error Then
MsgBox(4096, "ERROR", "Failed to read memory.")
Exit
EndIf
$CurrentLocX = floor(_MemoryRead(0x00BB6E94, $DllInformation, 'float'))
If @Error Then
MsgBox(4096, "ERROR", "Failed to read memory.")
Exit
EndIf
$CurrentLocY = floor(_MemoryRead(0x00BB6E90, $DllInformation, 'float'))
If @Error Then
MsgBox(4096, "ERROR", "Failed to read memory.")
Exit
EndIf
$CurrentRot = _MemoryRead(0x00C435C8, $DllInformation, 'float');0x00CD901C(richtig glaube)
If @Error Then
MsgBox(4096, "ERROR", "Failed to read memory.")
Exit
EndIf
$continentID = _MemoryRead(0x00B77044, $DllInformation, 'dword');007CF3D4w
If @Error Then
MsgBox(4096, "ERROR", "Failed to read memory.")
Exit
EndIf
$deathNY = _MemoryRead(0x00C58FD0, $DllInformation, 'dword')
If @Error Then
MsgBox(4096, "ERROR", "Failed to read memory.")
Exit
EndIf



_MemoryClose($DllInformation)
;Final Calculations
$Xstart = $CurrentLocX
$Ystart = $CurrentLocY
$CurrentRot = floor(($CurrentRot / (3.14159265358979/180)))
;Update GUI

ControlSetText($App_Title, "", $FinalCharname, $CurrentCharname)
ControlSetText($App_Title, "", $Finalrot, $CurrentRot)
ControlSetText($App_Title, "", $FinallocX, $CurrentLocX)
ControlSetText($App_Title, "", $Finallocy, $CurrentLocY)
ControlSetText($App_Title, "", $Finalrandom, $continentID)
EndFunc ;==>MemoryLoop

;;================================================ ================================
;;Rotationfix
;;================================================ ================================
func Rotationfix()
$posx2 = $CurrentLocX
$posy2 = (($CurrentLocY/"100")*$RatioConvertion )
$posx1 = $ARRAY[3][$array_x_number]
$posy1 = ((($ARRAY[4][$array_x_number])/"100")*$RatioConvertion )
$toposX = $ARRAY[3][$array_x_number]
$toposY = $ARRAY[4][$array_x_number]
$radToDeg = -180 / $pi
$result = atan(($posy1-$posy2)/($posx2-$posx1)) * $radToDeg
if $posx2 < $posx1 Then
if $result < 0 Then
$result = 270 + $result
Else
$result = 270 + $result
EndIf
EndIf
if $posx2 >= $posx1 Then
if $result < 0 Then
$result = 90 + $result
Else
$result = 90 + $result
EndIf
EndIf
$result = $result-360
$result = floor(($result - $result) - $result)
if $result = "360" Then $result = 0
EndFunc

;;================================================ ================================
;;Select XML;
;;================================================ ================================
func SelectOpenXML()
$xmlFile = FileOpenDialog("Open XML", @ScriptDir, "XML (*.XML)", 1)
If @error Then
MsgBox(4096, "Thermo Prime - File Open", "No file chosen, you must select a profile to be able to run the bot!")
Else
_FileWriteLog(@ScriptDir & $logname,"XML File Selected; " & $xmlFile)

if $test_pause = 0 Then
$oXSD = _XMLFileOpen ($xmlFile, "")
;If @error Or $oXSD < 1 Then
; MsgBox(0, "Error", "There was an error opening the file " & $xmlFile)
; $oXSD = 0
; _FileWriteLog(@ScriptDir & $logname,"Error Opning XMLFile - Ending Session")
; _FileWriteLog(@ScriptDir & $logname,":::End Of Session:::")
; Exit
;EndIf

$szXPath1 = "//DATAPACKET/METADATA/FIELDS"
$szXPath2 = "//DATAPACKET/ROWDATA"

$ARRAYX = _XMLGetNodeCount($szXPath1 & "/*")
$ARRAYY = _XMLGetNodeCount($szXPath2 & "/*")
$additional = $ARRAYY
;ReDim $ARRAY[$ARRAYX][$ARRAYY+1]
if $ARRAYY < 0 Then $ARRAYY = 0
TrayTip("Position Manager", $ARRAYY & " Nodes Loaded...", 5, 1)
$aNodeName1 = _XMLGetChildNodes ($szXPath1)
$aNodeName2 = _XMLGetChildNodes ($szXPath2)
If $aNodeName1 <> -1 Then
;LOOP THROUGH //DATAPACKET/METADATA/FIELDS
For $find = 1 To $aNodeName1[0]
_XMLGetAllAttrib($szXPath1 & "/*" & '[' & $find & ']',$aAttrName1,$aAttrVal1)
;ADD TO ARRAY
;$ARRAY[$find-1][0] = $aAttrVal1[0]
;LOOP THROUGH //DATAPACKET/ROWDATA
;For $X=1 To $aNodeName2[0]
; _XMLGetAllAttrib($szXPath2 & "/*" & '[' & $X & ']',$aAttrName2,$aAttrVal2)
; ;ONLY APPEND IF CURRENT FIELD NIMBER IS LESS THAN NUMBER OF ATTRIBS FOUND IN EACH ROW
; If $find <= Ubound($aAttrName2) Then
; $ARRAY[$find-1][$X] = $aAttrVal2[$find-1]
; EndIf
;Next
Next
Else
MsgBox(0, "Error:", "No nodes found for " & $szXPath1)
EndIf
;$arraynumber = ($ARRAY[2][$ARRAYY])
$array_x_number = 0;$arraynumber


$oXSD = 0
EndIf
Return
EndIf
Return
Endfunc ;==>SelectOpenXML

;;================================================ ================================
;;Create New XML;
;;================================================ ================================
func NewProfile()
$newprfname = InputBox("Auto-Travel - New Profile", "Enter Profile Name.", "", "", 20,20)
If @error Then
MsgBox(4096, "Auto-Travel - New Profile", "No Profile Created")
Else
$newprfname = ($newprfname & ".xml")
If FileExists ($newprfname) Then
$answer1 = msgbox(4,"Auto-Travel - New Profile","A profile with that name; " & $newprfname & " does allready exists. Do you want to overwrite this file?")
if $answer1 = 6 Then
FileDelete ($newprfname)
Else
Return
EndIf
EndIf
_FileCreate($newprfname)
$file = FileOpen($newprfname, 1)
FileWriteLine($newprfname, "<?xml version=""1.0"" encoding=""UTF-8"" standalone=""yes""?>")
FileWriteLine($newprfname, "<DATAPACKET Version=""2.0"">")
FileWriteLine($newprfname, " <METADATA>")
FileWriteLine($newprfname, " <FIELDS>")
FileWriteLine($newprfname, " <FIELD attrname=""Continent"" fieldtype=""i4""/>")
FileWriteLine($newprfname, " <FIELD attrname=""Zone"" fieldtype=""i4""/>")
FileWriteLine($newprfname, " <FIELD attrname=""Nr"" fieldtype=""i4""/>")
FileWriteLine($newprfname, " <FIELD attrname=""posX"" fieldtype=""i4""/>")
FileWriteLine($newprfname, " <FIELD attrname=""posY"" fieldtype=""i4""/>")
FileWriteLine($newprfname, " <FIELD attrname=""Comment"" fieldtype=""string"" WIDTH=""20""/>")
FileWriteLine($newprfname, " </FIELDS>")
FileWriteLine($newprfname, " <PARAMS/>")
FileWriteLine($newprfname, " </METADATA>")
FileWriteLine($newprfname, " <ROWDATA>")
FileWriteLine($newprfname, " </ROWDATA>")
FileWriteLine($newprfname, " <ROWGHOST>")
FileWriteLine($newprfname, " </ROWGHOST>")
FileWriteLine($newprfname, "</DATAPACKET>")
FileClose($newprfname)
Exit
Return
EndIf
EndFunc ;==>NewProfile

;;================================================ ================================
;;SaveDestinationGhost;
;;================================================ ================================
Func SaveDestination_Ghost()
if $test_pause = 0 Then
$toposX = $CurrentLocX
$toposY = $CurrentLocY

$oXSD = _XMLFileOpen ($xmlFile, "")
If @error Or $oXSD < 1 Then
MsgBox(0, "Error", "There was an error opening the file " & $xmlFile)
$oXSD = 0
_FileWriteLog(@ScriptDir & $logname,"Error Opening XMLFile- Ending Session")
_FileWriteLog(@ScriptDir & $logname,":::End Of Session:::")
Exit
EndIf

$szXPath1 = "//DATAPACKET/METADATA/FIELDS"
$szXPath2 = "//DATAPACKET/ROWGHOST"

$ARRAYX = _XMLGetNodeCount($szXPath1 & "/*")
$ARRAYY = _XMLGetNodeCount($szXPath2 & "/*")
if $ARRAYY = -1 then
$ARRAYY = 0
EndIf
$additional = $ARRAYY
ReDim $ARRAY[$ARRAYX][$ARRAYY+1]
TrayTip("Position Manager", $ARRAYY & " Nodes Loaded...", 5, 1)
$aNodeName1 = _XMLGetChildNodes ($szXPath1)
$aNodeName2 = _XMLGetChildNodes ($szXPath2)
If $aNodeName1 <> -2 Then
;LOOP THROUGH //DATAPACKET/METADATA/FIELDS
For $find = 1 To $aNodeName1[0]
_XMLGetAllAttrib($szXPath1 & "/*" & '[' & $find & ']',$aAttrName1,$aAttrVal1)
;ADD TO ARRAY
$ARRAY[$find-1][0] = $aAttrVal1[0]
;LOOP THROUGH //DATAPACKET/ROWDATA
if $ARRAYY > 0 Then
For $X=1 To $aNodeName2[0]
_XMLGetAllAttrib($szXPath2 & "/*" & '[' & $X & ']',$aAttrName2,$aAttrVal2)
;ONLY APPEND IF CURRENT FIELD NIMBER IS LESS THAN NUMBER OF ATTRIBS FOUND IN EACH ROW
If $find <= Ubound($aAttrName2) Then
$ARRAY[$find-1][$X] = $aAttrVal2[$find-1]
EndIf
Next
EndIf
Next
Else
MsgBox(0, "Error:", "No nodes found for " & $szXPath1)
EndIf
$arraynumber = ($ARRAY[2][$ARRAYY])
$array_x_number = 0;$arraynumber

;MsgBox(0, "hej", $ARRAY[2][$ARRAYY]);[$additional])
$oXSD = 0
$currentZone=1
$numb = $ARRAY[2][$additional]
$CHILDVALUES = _ArrayCreate ($continentID,$currentZone,($numb+1),$toposX,$topo sY,"For Testing")
_XMLCreateChildWAttr("//DATAPACKET/ROWGHOST[1]", "ROWGHOST", $CHILDATTRIBS, $CHILDVALUES) ;by node index
if $debug = 1 then
send("{Enter}")
sleep(200)
Clipput("Waypoint - " & ($numb+1) & " pos: " & $toposX & "." & $toposY)
_FileWriteLog(@ScriptDir & $logname,"Waypoint - " & ($numb+1) & ". Saves pos: " & $toposX & "." & $toposY)
sleep(20)
Send("^v")
sleep(200)
send("{Enter}")
EndIf
EndIf
Return
EndFunc

;;================================================ ================================
;;MouseMovePlus (thx to Oxin8 for this code)
;;================================================ ================================
Func _MouseMovePlus($X, $Y,$absolute = 0)
Local $MOUSEEVENTF_MOVE = 1
Local $MOUSEEVENTF_ABSOLUTE = 32768
DllCall("user32.dll", "none", "mouse_event", _
"long", $MOUSEEVENTF_MOVE + ($absolute*$MOUSEEVENTF_ABSOLUTE), _
"long", $X, _
"long", $Y, _
"long", 0, _
"long", 0)
EndFunc

;;================================================ ================================
;;Terminate;
;;================================================ ================================
func terminate()
WinSetOnTop($App_Title, "", 0)
send ("{w}")
If $MouseDown = 1 Then
MouseUp("right")
EndIf
msgbox(1,"Info","Terminate")
_FileWriteLog(@ScriptDir & $logname,"User Termination - Ending Session")
_FileWriteLog(@ScriptDir & $logname,":::End Of Session:::")
exit 0
EndFunc ;==>Terminate




meak1 is offline  
Old   #2
 
elite*gold: 0
Join Date: Jun 2007
Posts: 58
Received Thanks: 4
ich kenn jetzt Autoit nicht so gut aber WoW du hast dir ja Mühe gegeben

Allerdings ist ja Autoit er zur Automatisierung, um z.b. Die Maus wohin zu schieben, und so, welches man mit anderen Sprachen nicht so gut machen kann.

Ich würde dir C++ empfehlen oder C# oder Visual Basic auch unter umständen...
OK och verstehe dich, Autoit ist besser als Warden, aber du kannst dir ja ne Word.exe machen und die läuft dann "angeblich" und mit der kannst du auch eine Hidden_Bot.exe starten, aber besser wäre es einfach nur die Word laufen zu lassen am besten in einen Ordner Microsoft Office ... dann ladeste einfach in ne Var einen langen text und die können nichts mehr sgaen, wobei ich nichtmal weiß ob die den Ram checken (dürfen)


M@rcthem@st3r is offline  
Old   #3
 
elite*gold: 220
Join Date: Jun 2007
Posts: 3,764
Received Thanks: 1,114
hm ich find er läuft das ganze gut ab aber wie gesagt manchmal läuft er ein bissl neben einer coordinate und dann probiert er ganze zeit da drauf zu kommen aber kriegt es net hin deswegn will ich das er das nicht mehr ganz so streng checkt also das er ruhig paar X und Y werte höher oder niedriger liegt
meak1 is offline  
Old   #4
 
elite*gold: 20
Join Date: Sep 2006
Posts: 1,100
Received Thanks: 185
Du musst ganz einfach deine Check ob die Coords stimmen etwas abändern, und zwar indem du eine art Toleranz bereich progst, sprich wie weit die Waypoints abweichen dürfen, im code setzt du das um indem du das etwa so machst
if destcord+1>=realcord && destcord-1<=reald cord then ok ^.^
du musst natürlich erstmal prüfen wie genau es sein muss, das der bot noch halbwegs den Weg findet.
MfG Bot


Bot_interesierter is offline  
Thanks
1 User
Old   #5
 
elite*gold: 220
Join Date: Jun 2007
Posts: 3,764
Received Thanks: 1,114
jo

er findet den weg ja eig. immer aber manchmal ist er wirklich 1 ne X achse zu weit das stört mich nicht er muss nicht so genau drauf laufen trozdem danke werd mal probiern wenn ich die neuen X y und rotations addressen habe aber kriege das mit rotations addresse nicht mehr hin i-wie <.<
meak1 is offline  
Old   #6
 
elite*gold: 0
Join Date: Mar 2008
Posts: 25
Received Thanks: 1
die Auflösung spielt keine relevante rolle ?


pspblackie is offline  
Reply



« Previous Thread | Next Thread »

Similar Threads
[AutoIt]Waypoint für meinen Bot
Hallo zusammen, Ich programmiere momentan einen netten bot für city of heroes, Das meiste ist schon getan und funktionieren tut er auch. Nun...
2 Replies - AutoIt
Waypoint
hab das Tool Waypointer runtergeladen und krieg da ja son echt schönen text mit : moveto(bblblbla) , hat einer die func von _moveto oder was muss ich...
4 Replies - Guild Wars
New Waypoint Bot Released
I recently managed to crack (after alot of hard work) a still unreleased bot. This bot is very similar to MMOglider (has way points, kills shit)...
18 Replies - WoW Exploits, Hacks, Tools & Macros
Nearest Waypoint is too far away
nabend leute&#33; ich hab mir vorhin auch ma n paar public proflies geholt aber ich habe damit noch einige probleme... nachdem ich das profil geladen...
7 Replies - WoW Bots



All times are GMT +1. The time now is 16:59.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2017 elitepvpers All Rights Reserved.