;;--------------------------------------------------------------------------------
;; SaveNewWP()
;;--------------------------------------------------------------------------------
Func SaveNewWP($_x, $_y, $_z, $_a, $m_range)
;;--------------------------------------------------------------------------------
;_log("SaveNewWP")
;;--------------------------------------------------------------------------------
$gaWP[UbOund($gaWP,1) - 1][0] = $_x
$gaWP[UbOund($gaWP,1) - 1][1] = $_y
$gaWP[UbOund($gaWP,1) - 1][2] = $_z
$gaWP[UbOund($gaWP,1) - 1][3] = $_a
$gaWP[UbOund($gaWP,1) - 1][4] = $m_range
;;--------------------------------------------------------------------------------
;_log("$gaWP[x][0] : " & $gaWP[UbOund($gaWP,1) - 1][0])
;_log("$gaWP[x][1] : " & $gaWP[UbOund($gaWP,1) - 1][1])
;_log("$gaWP[x][2] : " & $gaWP[UbOund($gaWP,1) - 1][2])
;_log("$gaWP[x][3] : " & $gaWP[UbOund($gaWP,1) - 1][3])
;_log("$gaWP[x][4] : " & $gaWP[UbOund($gaWP,1) - 1][4])
EndFunc
;;--------------------------------------------------------------------------------
;; CreateNewWP()
;;--------------------------------------------------------------------------------
Func CreateNewWP()
;;--------------------------------------------------------------------------------
_log("CreateNewWP")
;;--------------------------------------------------------------------------------
Redim $gaWP[UbOund($gaWP,1) + 1][5]
;;--------------------------------------------------------------------------------
EndFunc
;;--------------------------------------------------------------------------------
;; InitializeVarWayPoints()
;;--------------------------------------------------------------------------------
Func InitializeWayPoints()
Dim $gaWP[1][5] = [[0,0,0,0,0]]
$giPosInWP = 0
EndFunc
;;--------------------------------------------------------------------------------
;; AnalyzeSpell()
;;--------------------------------------------------------------------------------
Func AnalyzeSpell($sGUID, $sObjName)
Dim $bFndSpell
Dim $bSpellIsActive
Dim $iRow
Dim $iRowCount
;;--------------------------------------------------------------------------------
_log("AnalyzeSpell")
;;--------------------------------------------------------------------------------
$bFndSpell = False
$bSpellIsActive = True
;;--------------------------------------------------------------------------------
$iRowCount = UBound($gaSpell, 1) - 1
For $iRow = 0 To $iRowCount
_log($gaSpell[$iRow][0] & " " & $gaSpell[$iRow][1])
;_log($sGUID & " " & $sObjName)
If $gaSpell[$iRow][0] = $sGUID And $gaSpell[$iRow][1] = $sObjName Then
$bFndSpell = True
ExitLoop
EndIf
Next
;;--------------------------------------------------------------------------------
_log("$bFndSpell :" & $bFndSpell)
;;--------------------------------------------------------------------------------
If $bFndSpell Then
If TimerDiff($gaSpell[$iRow][2]) > $gaSpell[$iRow][3] Then $bSpellIsActive = False
Else
$gaSpell[UbOund($gaSpell, 1) - 1][0] = $sGUID
$gaSpell[UbOund($gaSpell, 1) - 1][1] = $sObjName
$gaSpell[UbOund($gaSpell, 1) - 1][2] = TimerInit()
$gaSpell[UbOund($gaSpell, 1) - 1][3] = 6820
Redim $gaSpell[UbOund($gaSpell, 1) + 1][4]
EndIf
;;--------------------------------------------------------------------------------
_log("Spell is active ? :" & $bSpellIsActive)
;;--------------------------------------------------------------------------------
Return $bSpellIsActive
EndFunc
;;--------------------------------------------------------------------------------
;; IsSafeArea()
;;--------------------------------------------------------------------------------
Func IsSafeArea($m_Range)
Dim $bIsSafeArea
Dim $hIndex, $hOffset, $count, $aItem[10]
;;--------------------------------------------------------------------------------
_log("IsSafeArea")
;;--------------------------------------------------------------------------------
$bIsSafeArea = True
;;--------------------------------------------------------------------------------
StartIterateObjectsList($hIndex, $hOffset, $count)
While IterateObjectsList($hIndex, $hOffset, $count, $aItem)
If $aItem[9] < $m_Range Then
If $aItem[0] <> "" Then
If StringInStr($aItem[1], "Grenadier_Proj",0) Or StringInStr($aItem[1], "Mortar",0) Or _
StringInStr($aItem[1], "creepMobArm",0) Or StringInStr($aItem[1], "morluSpellcast",0) Or _
StringInStr($aItem[1], "waller",0) Then
$bIsSafeArea = False
EndIf
If StringInStr($aItem[1], "iceClusters",0) Or StringInStr($aItem[1], "frozen",0) Or StringInStr($aItem[1], "deathExplosion",0) Or _
StringInStr($aItem[1], "deathStart",0) Or StringInStr($aItem[1], "morluSpellcast",0) Or StringInStr($aItem[1], "ArcaneEnchanted",0) Or _
StringInStr($aItem[1], "Desecrator",0) Or StringInStr($aItem[1], "Molten",0) Or StringInStr($aItem[1], "PetSweep",0) Or _
StringInStr($aItem[1], "Plagued",0) Then
$bIsSafeArea = Not AnalyzeSpell(String($aItem[0]), String($aItem[1]))
EndIf
If $aItem[0] <> 0xFFFFFFFF Then
If (CheckFromList($monsterList, $aItem[1]) And $aItem[6] <> -1) Or (CheckFromList($monsterList, $aItem[1]) And (StringInStr($aItem[1], "Brickhouse_") Or StringInStr($aItem[1], "goblin") Or StringInStr($aItem[1], "woodwraith_"))) Then
If IterateActorAtribs($aItem[0], $Atrib_Hitpoints_Cur) > 0 And IterateActorAtribs($aItem[0], $Atrib_Invulnerable) = 0 Then
$bIsSafeArea = False
EndIf
EndIf
EndIf
EndIf
EndIf
;If $bIsSafeArea = False Then ExitLoop
WEnd
;;--------------------------------------------------------------------------------
Return $bIsSafeArea
EndFunc
;;--------------------------------------------------------------------------------
;; MoveToWayPoints()
;;--------------------------------------------------------------------------------
Func MoveToWayPoints($m_range)
Dim $fPosX
Dim $fPosY
Dim $fPosZ
Dim $fTimer
Dim $fDistance
Dim $fTimeToMove
Dim $aPrvLoc
Dim $aCurLoc
Dim $aMouseCoord
;;--------------------------------------------------------------------------------
_log("MoveToWayPoints")
_log("$giPosInWP O: " & $giPosInWP)
;;--------------------------------------------------------------------------------
If $giPosInWP = 0 Then Return
If $giMotionless > 4 Then Return
;;--------------------------------------------------------------------------------
$fDistance = 0
$fTimer = TimerInit()
;;--------------------------------------------------------------------------------
$aPrvLoc = GetCurrentPos()
$fTimeToMove = TimerInit()
While $fDistance < $m_range
$aMouseCoord = FromD3toScreenCoords($gaWP[$giPosInWP - 1][0], $gaWP[$giPosInWP - 1][1], $gaWP[$giPosInWP - 1][2])
MouseMove($aMouseCoord[0], $aMouseCoord[1], 3)
MouseClick("middle")
$aCurLoc = GetCurrentPos()
$fPosX = $aPrvLoc[0] - $aCurLoc[0]
$fPosY = $aPrvLoc[1] - $aCurLoc[1]
$fPosZ = $aPrvLoc[2] - $aCurLoc[2]
$fDistance = Sqrt($fPosX * $fPosX + $fPosY * $fPosY + $fPosZ * $fPosZ)
If GetDistance($gaWP[$giPosInWP - 1][0], $gaWP[$giPosInWP - 1][1], $gaWP[$giPosInWP - 1][2]) < 4 And $giPosInWP > 0 Then $giPosInWP -= 1
If TimerDiff($fTimeToMove) > 1800 Or ($fDistance < 4 And TimerDiff($fTimeToMove) > 400) Then ExitLoop
If $giPosInWP = 0 Then ExitLoop
WEnd
If $fDistance = 0 And TimerDiff($fTimeToMove) > 400 Then $giMotionless += 1
If $fDistance >= $m_range Then $giMotionless = 0
;;--------------------------------------------------------------------------------
_log("$giPosInWP F: " & $giPosInWP)
_log("Distance : " & $fDistance)
_log("Timer : " & TimerDiff($fTimer))
_log("Time to move : " & TimerDiff($fTimeToMove))
;;--------------------------------------------------------------------------------
EndFunc
;;--------------------------------------------------------------------------------
;; MoveToLastWP()
;;--------------------------------------------------------------------------------
Func MoveToLastWP()
Dim $fTimer
Dim $bRetVal
;--------------------------------------------------------------------------------
_log("MoveToLastWP")
;--------------------------------------------------------------------------------
$fTimer = TimerInit()
While $giPosInWP < UBound($gaWP, 1) - 1
;--------------------------------------------------------------------------------
If GameOver() Then ExitLoop
;--------------------------------------------------------------------------------
If $gaWP[$giPosInWP + 1][3] = 1 Then Attack()
If IsSafeArea($giSfArea * 2) Then
$bRetVal = Grab()
If $bRetVal < 2 Then
MoveNow($gaWP[$giPosInWP + 1][0], $gaWP[$giPosInWP + 1][1], $gaWP[$giPosInWP + 1][2], $gaWP[$giPosInWP + 1][3], $gaWP[$giPosInWP + 1][4])
$giPosInWP += 1
EndIf
EndIf
;--------------------------------------------------------------------------------
WEnd
;;--------------------------------------------------------------------------------
_log("Timer : " & TimerDiff($fTimer))
;;--------------------------------------------------------------------------------
EndFunc
;;--------------------------------------------------------------------------------
;; MoveNow()
;;--------------------------------------------------------------------------------
Func MoveNow($_x, $_y, $_z, $_a, $m_range)
Dim $TimeOut = TimerInit()
Dim $toggletry = 0
Dim $lastwp_x = $_x
Dim $lastwp_y = $_y
Dim $lastwp_z = $_z
;;--------------------------------------------------------------------------------
If GameOver() Then Return
;;--------------------------------------------------------------------------------
$Coords = FromD3toScreenCoords($_x, $_y, $_z)
MouseMove($Coords[0], $Coords[1], 3)
$LastCP = GetCurrentPos()
MouseDown("middle")
Sleep(10)
While 1
$CurrentLoc = GetCurrentPos()
$xd = $lastwp_x - $CurrentLoc[0]
$yd = $lastwp_y - $CurrentLoc[1]
$zd = $lastwp_z - $CurrentLoc[2]
$Distance = Sqrt($xd * $xd + $yd * $yd + $zd * $zd)
If $Distance < $m_range Then ExitLoop
;If _MemoryRead($ClickToMoveToggle, $d3, 'float') = 0 Then ExitLoop
Local $angle = 1
Local $Radius = 25
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
While _MemoryRead($ClickToMoveToggle, $d3, 'float') = 0
;_log("Togglemove : " & _MemoryRead($ClickToMoveToggle, $d3, 'float'))
$Coords = FromD3toScreenCoords($_x, $_y, $_z)
$angle += $Step
$Radius += 45
;MouseMove($Coords[0] - (Cos($angle) * $Radius), $Coords[1] - (Sin($angle) * $Radius), 3)
; ci desssous du dirty code pour eviter de cliquer n'importe ou hos de la fenetre du jeu
$Coords[0] = $Coords[0] - (Cos($angle) * $Radius)
$Coords[1] = $Coords[1] - (Sin($angle) * $Radius)
If $Coords[0] > 790 Then
$Coords[0] = 790
ElseIf $Coords[0] < 40 Then ;car on a pas l'envie de cliquer dans les icone du chat
$Coords[0] = 40
EndIf
If $Coords[1] > 540 Then ;car on a pas l'envie de cliquer dans la bare des skills
$Coords[1] = 540
ElseIf $Coords[1] < 10 Then
$Coords[1] = 10
EndIf
MouseMove($Coords[0], $Coords[1], 3)
$toggletry += 1
;_log("Tryin move :" & " x:" & $_x & " y:" & $_y & "coords: " & $Coords[0] & "-" & $Coords[1] & " angle: " & $angle & " Toggle try: " & $toggletry)
If $angle >= 2.0 * $PI Or $toggletry > 9 Or _playerdead() Then
$giSkippedMove += 1
_log("Toggle try: " & $toggletry & " Movement Skipped : " & $giSkippedMove)
ExitLoop 2 ; le 2 signifie que l'on quitte 2 loop
EndIf
Sleep(10)
WEnd
;;--------------------------------------------------------------------------------
Sleep(10)
$Coords = FromD3toScreenCoords($lastwp_x, $lastwp_y, $lastwp_z)
MouseMove($Coords[0], $Coords[1], 3)
If TimerDiff($TimeOut) > 60000 Then
_log("MoveToPos Timed out ! ! ! ")
If _checkdisconnect() Then $giGameOver = 1
ExitLoop
EndIf
WEnd
;;--------------------------------------------------------------------------------
MouseUp("middle")
EndFunc
;;--------------------------------------------------------------------------------
;; MoveToPos()
;;--------------------------------------------------------------------------------
Func MoveToPos($_x, $_y, $_z, $_a, $m_range)
If GameOver() Then Return
;--------------------------------------------------------------------------------
SaveNewWP($_x, $_y, $_z, $_a, $m_range)
MoveToLastWP()
CreateNewWP()
;--------------------------------------------------------------------------------
EndFunc ;==>MoveToPos
;;--------------------------------------------------------------------------------
;; Grab()
;;--------------------------------------------------------------------------------
Func Grab()
Dim $bGrabVal
Dim $aPrvLoc
Dim $aCurLoc
Dim $fTimer
Dim $fDistance
Dim $hIndex, $hOffset, $Count, $aItem[10]
;--------------------------------------------------------------------------------
_log("Grab")
;--------------------------------------------------------------------------------
$fTimer = TimerInit()
$giGrabTimeOut = 0
startIterateObjectsList($hIndex, $hOffset, $count)
While iterateObjectsList($hIndex, $hOffset, $count, $aItem)
If $aItem[0] <> "" And $aItem[0] <> 0xFFFFFFFF Then
If $aItem[9] < $g_range Then
If CheckFromList($monsterList, $aItem[1]) = False Then
If StringInStr($IgnoreObjList, $aItem[8]) = 0 And CheckFromList($shrinebanlist, $aItem[8]) = 0 Then
If stringInStr($aItem[1],"shrine") Then
If IterateActorAtribs($aItem[0], $Atrib_gizmo_state) <> 1 Then
If shrine($aItem[1], $aItem[8], $aItem[0]) = false Then $shrinebanlist = $shrinebanlist & "|" & $aItem[8]
EndIf
EndIf
;;--------------------------------------------------------------------------------
If ($aItem[5] = 2 And $aItem[6] = -1) Or (StringInStr($aItem[1], "orb") and StringInStr($aItem[1], "unique")) Then
If _MemoryRead($aItem[8] + 0x4, $d3, 'ptr') <> 0xFFFFFFFF Then
_log("Checking " & $aItem[8] & " : " & $aItem[1])
;;--------------------------------------------------------------------------------
$aItemDestination = CheckItem($aItem[0], $aItem[1])
If $aItemDestination = "Stash" Or $aItemDestination = "Salvage" Or ($aItemDestination = "Inventory" And $takepot = True) Then
;This loot is interesting
$aPrvLoc = GetCurrentPos()
;;--------------------------------------------------------------------------------
$bGrabVal = Grabit($aItem[1], $aItem[8])
If $bGrabVal = 0 Then
_log("Grab unsuccessfull")
If $giGrabTimeOut > 2 Then
_log("Grabtimeout : " & $giGrabTimeOut)
If _checkdisconnect() Or _playerdead() Then
_log('_checkdisconnect A or player D')
$giGameOver = 1
ExitLoop
EndIf
EndIf
Else
If $bGrabVal = 1 Then
_log("Grab successfull")
$bGrabVal = Grab()
ElseIf $bGrabVal = 2 Then
_log("Not a safe area")
EndIf
;Return to previous position ?
If GetDistance($aPrvLoc[0], $aPrvLoc[1], $aPrvLoc[2]) > 10 Then
$aMouseCoord = FromD3toScreenCoords($aPrvLoc[0], $aPrvLoc[1], $aPrvLoc[2])
MouseClick("middle", $aMouseCoord[0], $aMouseCoord[1], 1, 3)
EndIf
If $bGrabVal = 2 Then ExitLoop
EndIf
Else
_log("Ignoring " & $aItem[8] & " : " & $aItem[1])
$IgnoreObjList = $IgnoreObjList & $aItem[8] & " "
EndIf
;;--------------------------------------------------------------------------------
EndIf
EndIf
;;--------------------------------------------------------------------------------
EndIf
EndIf
EndIf
EndIf
WEnd
;;--------------------------------------------------------------------------------
_log("Timer : " & TimerDiff($fTimer))
;;--------------------------------------------------------------------------------
Return $bGrabVal
EndFunc ;==>Grab
;;--------------------------------------------------------------------------------
;; Grabit()
;;--------------------------------------------------------------------------------
Func Grabit($name, $hOffset)
Dim $fTimer
Dim $bRetVal
Dim $hOOffsetValue
Dim $aMouseCoord
;;--------------------------------------------------------------------------------
_log("Grabit")
;;--------------------------------------------------------------------------------
;Return 0 : grab unsuccessfull
;Return 1 : grab successfull
;Return 2 : Not safe zone
;;--------------------------------------------------------------------------------
$fTimer = TimerInit()
$hOOffsetValue = _MemoryRead($hOffset + 0x4, $d3, 'ptr')
If StringInStr($name, "gold") Then
$aMouseCoord = FromD3toScreenCoords(_MemoryRead($hOffset + 0xB0, $d3, 'float'), _MemoryRead($hOffset + 0xB4, $d3, 'float'), _MemoryRead($hOffset + 0xB8, $d3, 'float'))
MouseClick("middle", $aMouseCoord[0], $aMouseCoord[1], 1, 6)
Else
Interact( _MemoryRead($hOffset + 0xB0, $d3, 'float'), _MemoryRead($hOffset + 0xB4, $d3, 'float'), _MemoryRead($hOffset + 0xB8, $d3, 'float'))
EndIf
;;--------------------------------------------------------------------------------
While _MemoryRead($hOffset + 0x4, $d3, 'ptr') = $hOOffsetValue
If IsSafeArea($giSfArea * 2) = False Then
$bRetVal = 2
ExitLoop
EndIf
If StringInStr($name, "gold") Then
$aMouseCoord = FromD3toScreenCoords(_MemoryRead($hOffset + 0xB0, $d3, 'float'), _MemoryRead($hOffset + 0xB4, $d3, 'float'), _MemoryRead($hOffset + 0xB8, $d3, 'float'))
MouseClick("middle", $aMouseCoord[0], $aMouseCoord[1], 1, 6)
Else
Interact( _MemoryRead($hOffset + 0xB0, $d3, 'float'), _MemoryRead($hOffset + 0xB4, $d3, 'float'), _MemoryRead($hOffset + 0xB8, $d3, 'float'))
EndIf
If TimerDiff($fTimer) > $g_time Then
;After this time we should already had the item
_log("$fTimer) > $g_time")
$giGrabTimeOut += 1
$bRetVal = 0
ExitLoop
EndIf
Sleep(Random(60,100))
WEnd
;;--------------------------------------------------------------------------------
_log("_MemoryRead($hOffset + 0x4, $d3, 'ptr') :" & _MemoryRead($hOffset + 0x4, $d3, 'ptr'))
If _MemoryRead($hOffset + 0x4, $d3, 'ptr') = 0xFFFFFFFF Then $bRetVal = 1
;;--------------------------------------------------------------------------------
Return $bRetVal
EndFunc ;==>Grabit
;;--------------------------------------------------------------------------------
;; Attack()
;;--------------------------------------------------------------------------------
Func Attack()
Dim $bRetVal
Dim $hIndex, $hOffset, $count, $aItem[10]
;--------------------------------------------------------------------------------
_log("Attack")
;--------------------------------------------------------------------------------
If AreYouAlive() = False Then Return
;--------------------------------------------------------------------------------
$giKillTimeOut = 0
startIterateObjectsList($hIndex, $hOffset, $count)
While iterateObjectsList($hIndex, $hOffset, $count, $aItem)
If $aItem[0] <> "" And $aItem[0] <> 0xFFFFFFFF Then
If ($aItem[9] < $a_range) Then
If (CheckFromList($monsterList, $aItem[1]) And $aItem[6] <> -1) Or (CheckFromList($monsterList, $aItem[1]) And (StringInStr($aItem[1], "Brickhouse_") Or StringInStr($aItem[1], "goblin") Or StringInStr($aItem[1], "woodwraith_"))) Then
;;--------------------------------------------------------------------------------
If IterateActorAtribs($aItem[0], $Atrib_Hitpoints_Cur) > 0 And IterateActorAtribs($aItem[0], $Atrib_Invulnerable) = 0 Then
$bRetVal = KillMob($aItem[8], $aItem[0])
If $bRetVal = 1 Then
_Log("Kill successfull")
ElseIf $bRetVal = 2 Then
_log("Kill time out.")
$giKillTimeOut += 1
If AreYouAlive() = False Then ExitLoop
EndIf
Else
If AreYouAlive() = False Then ExitLoop
EndIf
;;--------------------------------------------------------------------------------
EndIf
EndIf
EndIf
WEnd
EndFunc ;==>Attack
;;--------------------------------------------------------------------------------
;; KillMob()
;;--------------------------------------------------------------------------------
Func KillMob($hOffset, $guid)
Dim $fTimer
Dim $bRetVal
Dim $aMouseCoord
;;--------------------------------------------------------------------------------
_log("KillMob")
;;--------------------------------------------------------------------------------
;Return 0 : Kill unsuccessfull
;Return 1 : Kill successfull
;Return 2 : Kill time out
$bRetVal = 0
$fTimer = TimerInit()
;;--------------------------------------------------------------------------------
;loop the attack until the mob is dead
Send("{SHIFTDOWN}")
While $bRetVal = 0
$aMouseCoord = FromD3toScreenCoords(_MemoryRead($hOffset + 0xB0, $d3, 'float'), _MemoryRead($hOffset + 0xB4, $d3, 'float'), _MemoryRead($hOffset + 0xB8, $d3, 'float'))
MouseMove($aMouseCoord[0], $aMouseCoord[1], 3)
MouseClick("left")
CheckForSpell()
CheckForPotion()
If IsSafeArea($giSfArea) = False Then
Send("{SHIFTUP}")
MoveToWayPoints($giSfArea)
Send("{SHIFTDOWN}")
$fTimer = TimerInit()
EndIf
If Floor(IterateActorAtribs($guid, $Atrib_Hitpoints_Cur)) = 0 Then
$bRetVal = 1
ExitLoop
EndIf
If TimerDiff($fTimer) > $a_time Then
$bRetVal = 2
ExitLoop
EndIf
WEnd
Send("{SHIFTUP}")
;;--------------------------------------------------------------------------------
Return $bRetVal
EndFunc ;==>KillMob
;;--------------------------------------------------------------------------------
;; AreYouAlive()
;;--------------------------------------------------------------------------------
Func AreYouAlive()
Dim $bRetVal
;;--------------------------------------------------------------------------------
$bRetVal = True
;;--------------------------------------------------------------------------------
If $giMotionless > 4 And (_CheckDisconnect() Or _PlayerDead()) Then $bRetVal = False
If $giKillTimeOut > 2 And (_CheckDisconnect() Or _PlayerDead()) Then $bRetVal = False
;;--------------------------------------------------------------------------------
Return $bRetVal
EndFunc
;;--------------------------------------------------------------------------------
;; GameOver()
;;--------------------------------------------------------------------------------
Func GameOver()
Dim $bRetVal
;;--------------------------------------------------------------------------------
$bRetVal = False
;;--------------------------------------------------------------------------------
If AreYouAlive() = False Then $bRetVal = True
If GameOverTime() Then $bRetVal = True
If $giSkippedMove > 6 Then $bRetVal = True
If $giGameOver = 1 Then $bRetVal = True
;;--------------------------------------------------------------------------------
Return $bRetVal
EndFunc ;==>GameOver
Func GameOverTime()
Dim $bRetVal
;;--------------------------------------------------------------------------------
If TimerDiff($giTimerMaxGameLength) > $maxgamelength Then
_log('game over time !')
$bRetVal = True
Else
$bRetVal = False
EndIf
;;--------------------------------------------------------------------------------
Return $bRetVal
EndFunc ;==>GameOverTime
Func _townportal()
_log("Town Portal")
If _playerdead() = False Then
Sleep(200)
Send("t")
Sleep(Random(8000, 8500, 1))
InitializeWayPoints()
Else
_log("No TP Cuz Your dead allready <img src='http://img.gmstemple.com/public/style_emoticons/<#EMO_DIR#>/tongue.gif' class='bbc_emoticon' alt=':P' />")
EndIf
EndFunc ;==>_townportal
InitializeWayPoints() ;Initialize Waypoints environnement
EndIf
EndFunc ;==>TakeWP