ط§ظ„ط¨ظ‚ط§ط، ظ…ط³ط¬ظ„ ط¯ط§ط¦ظ…ط¢
ط§ظ„ط¥ط¹ظ„ط§ظ†ط§طھ
قديم 08-02-2013, 01:12 PM   #11

ميدو جديد
عضو نشيك



الصورة الرمزية ميدو جديد


• الانـتـسـاب » Jan 2011
• رقـم العـضـويـة » 78171
• المشـــاركـات » 84
• الـدولـة »
• الـهـوايـة »
• اسـم الـسـيـرفـر »
• الـجـنـس »
• نقـاط التقييم » 10
ميدو جديد صـاعـد

ميدو جديد غير متواجد حالياً



افتراضي



ده سكربيت لل bot بلغة auto it بس مش عرف طبيعة شغله ازاي وفيني يحط الاوبي كود للكل حاجة
كود:
#NoTrayIcon
#include <String.au3>
#include <GuiListView.au3>
#include <GuiListBox.au3>
#include <Array.au3>
#include "skillData.au3"
#include "itemData.au3"
#include "mobData.au3"
#include "soxData.au3"

;---------------------------------------------------------------------------------------

Global $run = false, $targetId, $target = false, $myX, $myY, $myId, $attackTimer, $pickTimer, $walkTimer, $targetTimer, $loggedIn = false
Global $curHp = 1, $curMp = 1, $maxHp = 1, $maxMp = 1, $hpPercent, $mpPercent, $charData, $zerkOrb = 0
Global $dropId, $drop = false, $killedId, $nextTarget, $imbueTimer, $mob_list[200], $drop_list[50], $buffing = false, $nextBuff, $buffTimer, $buffingDelay, $attackingusTimer = TimerInit()
Global $partyTimer = TimerInit(), $sroPid, $hidden = false, $charName = "", $stuckTimer = TimerInit()

Opt("GUIOnEventMode", 1)

;---------------------------------------------------------------------------------------


$GUI = GUICreate("[vSRO110] jreBot Lite", 662, 379, 234, 199)
GUICtrlCreateTab(8, 8, 489, 361)
GUICtrlCreateTabItem("Main")
GUICtrlCreateGroup("Training area (x, y, range)", 24, 49, 281, 81)
$xInput = GUICtrlCreateInput("", 40, 81, 41, 22)
$yInput = GUICtrlCreateInput("", 88, 81, 41, 22)
$rInput = GUICtrlCreateInput("100", 136, 81, 41, 22)
$setXY = GUICtrlCreateButton("Set Current", 208, 81, 75, 25)
GUICtrlCreateGroup("Pick", 320, 49, 129, 289)
$goldCbox = GUICtrlCreateCheckbox("Gold", 336, 81, 97, 17)
$itemCbox = GUICtrlCreateCheckbox("Equipments", 336, 113, 97, 17)
$welixirCbox = GUICtrlCreateCheckbox("Weapon elixirs", 336, 146, 97, 17)
$selixirCbox = GUICtrlCreateCheckbox("Shield elixirs", 336, 177, 97, 17)
$pelixirCbox = GUICtrlCreateCheckbox("Protector elixirs", 336, 209, 97, 17)
$aelixirCbox = GUICtrlCreateCheckbox("Accessory elixirs", 336, 241, 105, 17)
$questCbox = GUICtrlCreateCheckbox("Quest items", 336, 273, 97, 17)
GUICtrlCreateGroup("Log", 24, 145, 281, 193)
$log = GUICtrlCreateEdit("", 32, 169, 265, 161)
GUICtrlCreateTabItem("Settings")
GUICtrlCreateGroup("Other", 24, 51, 169, 297)
$deadCbox = GUICtrlCreateCheckbox("Back to town when dead", 40, 74, 145, 17)
$usezerkCbox = GUICtrlCreateCheckbox("Use zerk when full", 40, 107, 121, 17)
$usegiantCbox = GUICtrlCreateCheckbox("Use zerk on giant/pt mobs", 40, 138, 145, 17)
$targetgiantCbox = GUICtrlCreateCheckbox("Don't target giant/pt mobs", 40, 170, 145, 17)
$randomRadio = GUICtrlCreateRadio("If no mobs walk random", 40, 202, 137, 17)
GUICtrlSetState(-1, 1)
$centerRadio = GUICtrlCreateRadio("If no mobs walk center", 40, 234, 129, 17)
GUICtrlCreateGroup("Auto reform", 207, 49, 265, 185)
$titleInput = GUICtrlCreateInput("Long time party!", 223, 104, 233, 22)
$ptCbox = GUICtrlCreateCheckbox("Enable auto reform/Accept", 223, 72, 153, 17)
$type1Cbox = GUICtrlCreateRadio("4/4 Item Dist", 223, 136, 81, 17)
GUICtrlSetState(-1, 1)
$type2Cbox = GUICtrlCreateRadio("8/8 Item Dist", 327, 136, 81, 17)
$type3Cbox = GUICtrlCreateRadio("4/4 Item Share", 223, 160, 89, 17)
$Type4Cbox = GUICtrlCreateRadio("8/8 Item Share", 327, 160, 97, 17)
$lvlminInput = GUICtrlCreateInput("1", 223, 191, 49, 22)
$lvlmaxInput = GUICtrlCreateInput("110", 287, 191, 49, 22)
GUICtrlCreateTabItem("Skills")
$skillList = GUICtrlCreateListView("Name                             |ID", 23, 46, 170, 310)
$addSkill = GUICtrlCreateButton("Add Attack", 209, 78, 67, 17)
$delSkill = GUICtrlCreateButton("Del Attack", 209, 97, 67, 17)
$attackList = GUICtrlCreateList("", 289, 45, 193, 90)
$addBuff = GUICtrlCreateButton("Add Buff", 209, 190, 67, 17)
$delBuff = GUICtrlCreateButton("Del Buff", 209, 209, 67, 17)
$buffList = GUICtrlCreateList("", 289, 157, 193, 90)
$addImbue = GUICtrlCreateButton("Add Imbue", 208, 255, 67, 17)
$delImbue = GUICtrlCreateButton("Del Imbue", 208, 274, 67, 17)
$imbueInput = GUICtrlCreateInput("", 289, 260, 193, 22)
GUICtrlCreateLabel("Buffs recast time", 216, 306, 87, 18)
$recastInput = GUICtrlCreateInput("300", 309, 304, 49, 22)
GUICtrlCreateLabel("sec", 365, 304, 22, 18)
$2ndCbox = GUICtrlCreateCheckbox("Use 2nd weapon for buffing (inv 1st slot)", 213, 336, 257, 17)
GUICtrlCreateTabItem("Start Client")
GUICtrlCreateGroup("SRO Directory", 24, 50, 329, 121)
$sroInput = GUICtrlCreateInput("", 40, 81, 249, 22)
$browseSro = GUICtrlCreateButton("...", 296, 81, 51, 25)
$engCbox = GUICtrlCreateCheckbox("English Patch", 40, 129, 84, 17)
GUICtrlSetState(-1, $GUI_DISABLE)
$launchSro = GUICtrlCreateButton("Launch!", 136, 122, 139, 33)
GUICtrlCreateTabItem("")
GUICtrlCreateGroup("Character", 512, 8, 137, 193)
$charEdit = GUICtrlCreateEdit("", 520, 32, 121, 161, 4096)
$start = GUICtrlCreateButton("Start Bot", 512, 224, 139, 25)
$stop = GUICtrlCreateButton("Stop Bot", 512, 264, 139, 25)
$save = GUICtrlCreateButton("Save Settings", 512, 304, 139, 25)
$show = GUICtrlCreateButton("Show/Hide Client", 512, 344, 139, 25)
GUISetState(@SW_SHOW)

;---------------------------------------------------------------------------------------

TCPStartUp()
$socket = TCPConnect("127.0.0.1", 22580)
If @Error Then Exit
Load()


GUISetOnEvent(-3, "Close")
GUICtrlSetOnEvent($start, "Start")
GUICtrlSetOnEvent($stop, "Stop")
GUICtrlSetOnEvent($setXY, "SetXY")
GUICtrlSetOnEvent($addSkill, "AddAttack")
GUICtrlSetOnEvent($addBuff, "AddBuff")
GUICtrlSetOnEvent($delSkill, "DelAttack")
GUICtrlSetOnEvent($delBuff, "DelBuff")
GUICtrlSetOnEvent($addImbue, "AddImbue")
GUICtrlSetOnEvent($delImbue, "DelImbue")
GUICtrlSetOnEvent($browseSro, "BrowseSro")
GUICtrlSetOnEvent($launchSro, "LaunchSro")
GUICtrlSetOnEvent($show, "HideSro")
GUICtrlSetOnEvent($save, "SaveSettings")

;---------------------------------------------------------------------------------------

While 1
	$recv = ReadPacket()
	$size = Dec(StringMid($recv, 3, 2) & StringMid($recv, 1, 2))
	$opcode = StringMid($recv, 7, 2) & StringMid($recv, 5, 2)
	$data = StringMid($recv, 13)

	Switch $opcode
		Case "B021" ;object moving
			BeginParse($data, $size)
			$id = ParseDword()
			$flag = ParseByte()
			$xSection = Dec(ParseByte())
			$ySection = Dec(ParseByte())
			$xOffset = Dec(ParseWord())
			$zOffset = Dec(ParseWord())
			$yOffset = Dec(ParseWord())
			$x = ($xSection - 135) * 192 + ($xOffset /10 )
			$y = ($ySection - 92) * 192 + ($yOffset / 10 )
			If $id = $myId AND $flag = "01" Then
                        If $run = true AND Distance($myX, $x, $myY, $y) > 500 Then ;in case theres an error
				;nothing for now
	         	Else
                                   
                                $myX = $x
				$myY = $y
			EndIf
				If GUICtrlRead($blindCbox) = 1 Then
					$nextTarget = $id
				EndIf
			EndIf

		Case "B034"
			If $data = "021218" Then
				RemoveDrop($drop_list[0])
			EndIf

		Case "B045" ;select response
			If $size = 12 Then
				BeginParse($data, $size)
				$byte1 = ParseByte()
				$id = ParseDword()
				$byte2 = ParseByte()
				$hp = Dec(ParseDword())
				$byte3 = ParseByte()
				$byte4 = ParseByte()

				If $byte1 = "01" AND $byte2 = "01" AND $byte3 = "01" AND $byte4 = "05" AND $hp > 1 Then
					SetTarget($id)
				EndIf
			EndIf

		Case "B070" ;lot of things?
			BeginParse($data, $size)
			$flag = ParseByte()
			$type = ParseWord()
			If $flag = "01" Then
				$idc = ParseDword()
				$mobId = ParseDword()
				$idc = ParseDword()
				$victim = ParseDword()

				If $victim = $myId Then ;something attacking us
					If $run = true AND $mobId <> $targetId Then
						InjectPacket("7045", Rev($mobId))
					EndIf
				EndIf
			ElseIf $flag = "02" Then
				If $type = "3010" Then ;obstacle
					RemoveTarget($targetId)
				EndIf
			EndIf

		Case "3011" ;died =((((
			If $data = "04" AND $run = true AND GUICtrlRead($deadCbox) = 1 Then
				$run = false
				Sleep(4000)
				InjectPacket("3053", "01")
			EndIf

		Case "3013" ;chardata
			BeginParse($data, $size)
			LoadSkills($data)

		Case "3015" ;singe spawn
			BeginParse($data, $size)
			$model = ParseDword()
			If IsGold($model) = true Then
				$amount = Dec(ParseDword())
				$goldId = ParseDword()
				$globalParseIndex += 46
				$mobId = ParseDword()
				If $mobId = $killedId AND GUICtrlRead($goldCbox) = 1 Then
					SetDrop($goldId)
				EndIf
			ElseIf IsEquip($model) = true Then
				$dunno = ParseByte()
				$equipId = ParseDword()
				$globalParseIndex += 46
				$mobId = ParseDword()
				If $mobId = $killedId AND GUICtrlRead($itemCbox) = 1 Then
					SetDrop($equipId)
				EndIf
			ElseIf IsSox($model) = true Then
				$dunno = ParseByte()
				$equipId = ParseDword()
				$globalParseIndex += 46
				$mobId = ParseDword()
				If $mobId = $killedId AND GUICtrlRead($soxCbox) = 1 Then
					SetDrop($equipId)
				EndIf
			ElseIf IsElixir($model) = true Then
				$elixirId = ParseDword()
				$globalParseIndex += 46
				$mobId = ParseDword()
				If $mobId = $killedId AND GUICtrlRead($elixirCbox) = 1 Then
					SetDrop($elixirId)
				EndIf
			Else
				LoadMobs($data)
			EndIf

		Case "3016" ;singe despawn
			BeginParse($data, $size)
			$id = ParseDword()
			RemoveTarget($id)
			RemoveDrop($id)
			RemoveMob($id)

		Case "3017" ;groupspawn start
			BeginParse($data, $size)
			Global $spawnType = ParseByte()
			Global $spawnAmount = Dec(ParseWord())

		Case "3019" ;groupspawn/despawn
			BeginParse($data, $size)
			If $spawnType = "01" Then
				LoadMobs($data)
			ElseIf $spawnType = "02" Then
				For $i = 0 To $spawnAmount
					$id = ParseDword()
					RemoveTarget($id)
					RemoveDrop($id)
					RemoveMob($id)
				Next
			EndIf

		Case "3020" ;charspawn
			BeginParse($data, $size)
			$myId = ParseDword()

		Case "3056" ;exp received
			BeginParse($data, $size)
			$id = ParseDword()
			$killedId = $id
			RemoveTarget($id)
			RemoveMob($id)

		Case "3057" ;hp/mp update
			BeginParse($data, $size)
			$id = ParseDword()
			$flag = ParseByte()
			$unk = ParseByte()
			$type = ParseByte()
			If $type = "05" Then
				$hp = Dec(ParseDword())
				$mp = Dec(ParseDword())
				If $hp = 0 Then
					RemoveTarget($id)
					RemoveMob($id)
				EndIf
			EndIf

		Case "70A1" ;skill update
			BeginParse($data, $size)
			$newId = ParseDword()
			UpdateSkill($newId)
	EndSwitch

	If $run = true Then
		If $target = true AND $drop = false AND TimerDiff($attackTimer) > 300 AND $buffing = false Then
			UseSkill($targetId)
			$attackTimer = TimerInit()
		EndIf

		If $target = false AND TimerDiff($targetTimer) > 500 AND GUICtrlRead($blindCbox) <> 1 Then
			$nextTarget = $mob_list[0]
			If $nextTarget <> "" AND $nextTarget <> $killedId Then
				InjectPacket("7045", Rev($nextTarget))
			EndIf
			$targetTimer = TimerInit()
		EndIf

		If $target = false AND TimerDiff($targetTimer) > 500 AND GUICtrlRead($blindCbox) = 1 Then
			If $nextTarget <> "" AND $nextTarget <> $killedId Then
				InjectPacket("7045", Rev($nextTarget))
			EndIf
			$targetTimer = TimerInit()
		EndIf

		If $drop = true AND TimerDIff($pickTimer) > 500 AND $buffing = false AND $drop_list[0] <> "" Then
			InjectPacket("7074", "010201" & Rev($drop_list[0]))
			$pickTimer = TimerInit()
		EndIf

		If TimerDiff($walkTimer) > 2000 AND $target = false AND $buffing = false AND $drop = false Then
			Walk(GUICtrlRead($xInput), GUICtrlRead($yInput))
			$walkTImer = TimerInit()
		EndIf

		If TimerDiff($buffTimer) > GUICtrlRead($recastInput) * 1000 Then BeginBuffing()
		If TimerDiff($buffingDelay) > 4000 AND $buffing = true Then UseBuff()

		If TimerDiff($imbueTimer) > 1000 AND $target = true Then
			If GUICtrlRead($imbueInput) <> "" Then
				InjectPacket("7074", "0104" & Rev(GUICtrlRead($imbueInput)) & "00")
			EndIf
			$imbueTimer = TimerInit()
		EndIf
		
		If TimerDiff($walkTimer) > 2000 AND $drop = false Then
			$range = Sqrt(($myX - GUICtrlRead($xInput)) * ($myX - GUICtrlRead($xInput)) + ($myY - GUICtrlRead($yInput)) * ($myY - GUICtrlRead($yInput)))
			If $range >= GUICtrlRead($rInput) Then
				$target = false
				Walk(GUICtrlRead($xInput), GUICtrlRead($yInput))
			EndIf
			$walkTimer = TimerInit()
		EndIf

		If TimerDiff($zerkTimer) > 6000 Then
			If GUICtrlRead($zerkCbox) = 1 Then
				InjectPacket("70A7", "01")
			EndIf
			$zerkTimer = TimerInit()
		EndIf
	EndIf
WEnd

;GUI EVENT FUNCTIONS--------------------------------------------------------------------------

Func Close()
	Exit
EndFUnc

Func Start()
	Save()
	BeginBuffing()
	$attackTimer = TimerInit()
	$pickTimer = TimerInit()
	$walkTimer = TimerInit()
	$targetTimer = TimerInit()
	$imbueTimer = TimerInit()
	$zerkTimer = TimerInit()
	$target = false
	$drop = false
	$run = true
EndFunc

Func Stop()
	$run = false
EndFunc

Func SetXY()
	GUICtrlSetData($xInput, $myX)
	GUICtrlSetData($yInput, $myY)
EndFUnc

Func AddAttack()
	$index = _GUICtrlListView_GetSelectedIndices($skillList)
	$text = _GUICtrlListView_GetItemText($skillList, Int($index), 1)
	GUICtrlSetData($attackList, $text & "|")
EndFunc

Func AddBuff()
	$index = _GUICtrlListView_GetSelectedIndices($skillList)
	$text = _GUICtrlListView_GetItemText($skillList, Int($index), 1)
	GUICtrlSetData($buffList, $text & "|")
EndFunc

Func DelAttack()
	$index = _GUICtrlListBox_GetCurSel($attackList)
	_GUICtrlListBox_DeleteString($attackList, $index)
EndFunc

Func DelBuff()
	$index = _GUICtrlListBox_GetCurSel($buffList)
	_GUICtrlListBox_DeleteString($buffList, $index)
EndFunc

Func AddImbue()
	$index = _GUICtrlListView_GetSelectedIndices($skillList)
	$text = _GUICtrlListView_GetItemText($skillList, Int($index), 1)
	GUICtrlSetData($imbueInput, $text)
EndFunc

;---------------------------------------------------------------------------------------

Func ReadPacket()
	$recv = Hex(Binary(TCPRecv($socket, 2)))
	If $recv = "" Then
		Return ""
	Else
		$size = Dec(StringMid($recv, 3, 2) & StringMid($recv, 1, 2))
		$recv &= Hex(Binary(TCPRecv($socket, $size+4)))
		Return $recv
	EndIf
EndFunc

Func InjectPacket($opcode, $data, $security = "0100")
	$size = Hex(StringLen($data) / 2, 4)
	$size = StringMid($size, 3, 2) & StringMid($size, 1, 2)
	$opcode = StringMid($opcode, 3, 2) & StringMid($opcode, 1, 2)
	$packet = _HexToString($size & $opcode & $security & $data)
	TCPSend($socket, $packet)
EndFunc

Func Rev($val)
	$result = ""
	For $i = 1 To StringLen($val) / 2
		$byte = StringRight($val, 2)
		$val = StringTrimRight($val, 2)
		$result &= $byte
	Next
	Return $result
EndFunc

Func SetTarget($id)
	$targetId = $id
	$target = true
EndFunc

Func SetDrop($id)
	_ArrayPush($drop_list, $id, 1)
	$drop = true
	$attackTimer = TimerInit()
	$targetTimer = TimerInit()
	$pickTimer = TimerInit()
EndFunc

Func RemoveTarget($id)
	If $targetId = $id Then
		$targetId = ""
		$target = false
	EndIf
EndFunc

Func RemoveDrop($id)
	For $i = 0 To UBound($drop_list) - 1
		If $drop_list[$i] = $id Then
			_ArrayDelete($drop_list, $i)
			_ArrayAdd($drop_list, "")

			$attackTimer = TimerInit()
			$targetTimer = TimerInit()
			$pickTimer = TimerInit()
		EndIf
	Next

	If $drop_list[0] = "" Then $drop = false
EndFunc

Func IsGold($id)
	If $id = "00000001" Then
		Return true
	ElseIf $id = "00000002" Then
		Return true
	ElseIf $id = "00000003" Then
		Return true
	Else
		Return false
	EndIf
EndFunc

Func IsEquip($id)
	$search = _ArraySearch($item_id, $id)
	If $search <> -1 Then
		Return true
	Else
		Return false
	EndIf
EndFunc

Func IsSox($id)
	$search = _ArraySearch($sox_id, $id)
	If $search <> -1 Then
		Return true
	Else
		Return false
	EndIf
EndFunc

Func IsElixir($id)
	For $i = 3675 To 3682
		If $id = Hex($i, 8) Then
			Return true
		EndIf
	Next
	Return false
EndFunc

Func LoadSkills($data)
	_GUICtrlListView_DeleteAllItems($skillList)
	For $i = 0 To UBound($skill_id) - 1
		$id = StringMid($skill_id[$i], 1, 8)
		$name = StringMid($skill_id[$i], 10)

		If StringInStr($data, "01" & Rev($id) & "01") AND $id <> "00000500" Then
			GUICtrlCreateListViewItem($name & "|" & $id, $skillList)
		EndIf
	Next
EndFunc

Func UpdateSkill($newId)
	$id = ""
	$name = ""
	For $i = 0 To UBound($skill_id) - 1
		$id = StringMid($skill_id[$i], 1, 8)
		$name = StringMid($skill_id[$i], 10)
		If $id = $newId Then ExitLoop
	Next

	$index = _GUICtrlListView_FindText($skillList, $name)
	$oldId = _GUICtrlListView_GetItemText($skillList, Int($index), 1)
	If $index <> -1 Then
		_GUICtrlListView_DeleteItem($skillList, Int($index))
		GUICtrlCreateListViewItem($name & "|" & $newId, $skillList)
	EndIf

	$index = _GUICtrlListBox_FindString($attackList, $oldId)
	If $index <> -1 Then
		_GUICtrlListBox_DeleteString($attackList, Int($index))
		GUICtrlSetData($attackList, $newId & "|")
	EndIf

	$index = _GUICtrlListBox_FindString($buffList, $oldId)
	If $index <> -1 Then
		_GUICtrlListBox_DeleteString($buffList, Int($index))
		GUICtrlSetData($buffList, $newId & "|")
	EndIf

	If GUICtrlRead($imbueInput) = $oldId Then
		GUICtrlSetData($imbueInput, $newId)
	EndIf
EndFunc

Func Walk($x, $y)
	$xPosition = Mod($x, 192) * 10
	$yPosition = Mod($y, 192) * 10
	$xSection = ($x - $xPosition / 10) / 192 + 135
	$ySection = ($y - $yPosition / 10) / 192 + 92
	InjectPacket("7021", "01" & Hex($xSection, 2) & Hex($ySection, 2) & Rev(Hex($xPosition, 4)) & "FAFF" & Rev(Hex($yPosition, 4)))
EndFunc

Func UseSkill($monster)
	$count = _GUICtrlListBox_GetCount($attackList)
	$random = Random(0, $count)

	$skill = _GUICtrlListBox_GetText($attackList, $random)
	If $skill <> "" Then
		InjectPacket("7074", "0104" & Rev($skill) & "01" & Rev($monster))
	Else
		InjectPacket("7074", "010101" & Rev($monster))
	EndIf
EndFunc

Func BeginBuffing()
	$buffing = true
	$nextBuff = 0

	$buffingDelay = TimerInit()
	$buffTimer = TimerInit()
EndFunc

Func UseBuff()
	If $nextBuff = 0 Then
		If GUICtrlRead($2ndCbox) = 1 Then InjectPacket("7034", "000D060000", "0300")
	EndIf

	$buffingDelay = TimerInit()
	$skill = _GUICtrlListBox_GetText($buffList, $nextBuff)
	If $skill <> "" Then
		InjectPacket("7074", "0104" & Rev($skill) & "00")
	EndIf

	If $skill = "" Then
		If GUICtrlRead($2ndCbox) = 1 Then InjectPacket("7034", "000D060000", "0300")
		$buffing = false
	EndIf
	$nextBuff += 1
EndFunc

Func LoadMobs($data)
	For $i = 0 To UBound($monster_id) - 1
		$array = StringRegExp($data, Rev($monster_id[$i]) & "(.{44}?)", 3)
		If IsArray($array) Then
			For $x = 0 To UBound($array) - 1
				$id = StringMid($array[$x], 1, 8)
				$word = StringMid($array[$x], 41, 4)
				If StringMid(Rev($id), 1, 2) = "00" AND StringMid(Rev($id), 3, 2) <> "00" Then
					If $word = "0100" OR $word = "0001" OR $word = "0101" OR $word = "0000" Then
						_ArrayPush($mob_list, Rev($id), 1)
					EndIf
				EndIf
			Next
		EndIf
	Next
EndFunc

Func RemoveMob($id)
	For $i = 0 To UBound($mob_list) - 1
		If $mob_list[$i] = $id Then
			_ArrayDelete($mob_list, $i)
			_ArrayAdd($mob_list, "")
		EndIf
	Next
EndFunc

;-----------Packet parsing functions by pushedx!----------------------------------------

Func BeginParse($buffer, $size)
	Global $globalParseIndex = 1
	Global $globalParseSize = $size
	Global $globalParseBuffer = $buffer
EndFunc

Func ParseByte()
	$result = StringMid($globalParseBuffer, $globalParseIndex, 2)
	$globalParseIndex = $globalParseIndex + 2
	return $result
EndFunc

Func ParseWord()
	$low = ParseByte()
	$hi = ParseByte()
	return $hi & $low
EndFunc

Func ParseDword()
	$low = ParseWord()
	$hi = ParseWord()
	return $hi & $low
EndFunc

Func ParseQWord()
	$low = ParseDword()
	$hi = ParseDword()
	return $hi & $low
EndFunc

Func ParseAscii($length)
	$result = StringMid($globalParseBuffer, $globalParseIndex, $length * 2)
	$globalParseIndex = $globalParseIndex + ($length * 2)
	$len = StringLen($result)
	$strResult = ""
	For $i = 1 to $len Step 2
		$strResult = $strResult & Chr(Dec(StringMid($result, $i, 2)))
	Next
	return $strResult
EndFunc

;----------------------------------------------------------------------------------------

Func Save()
	IniWrite(@ScriptDir & "\jreBot.ini", $charName, "xInput", GUICtrlRead($xInput))
	IniWrite(@ScriptDir & "\jreBot.ini", $charName, "yInput", GUICtrlRead($yInput))
	IniWrite(@ScriptDir & "\jreBot.ini", $charName, "rInput", GUICtrlRead($rInput))
	IniWrite(@ScriptDir & "\jreBot.ini", $charName, "goldCbox", GUICtrlRead($goldCbox))
	IniWrite(@ScriptDir & "\jreBot.ini", $charName, "itemCbox", GUICtrlRead($itemCbox))
	IniWrite(@ScriptDir & "\jreBot.ini", $charName, "welixirCbox", GUICtrlRead($welixirCbox))
	IniWrite(@ScriptDir & "\jreBot.ini", $charName, "selixirCbox", GUICtrlRead($selixirCbox))
	IniWrite(@ScriptDir & "\jreBot.ini", $charName, "pelixirCbox", GUICtrlRead($pelixirCbox))
	IniWrite(@ScriptDir & "\jreBot.ini", $charName, "aelixirCbox", GUICtrlRead($aelixirCbox))
	IniWrite(@ScriptDir & "\jreBot.ini", $charName, "questCbox", GUICtrlRead($questCbox))
	IniWrite(@ScriptDir & "\jreBot.ini", $charName, "deadCbox", GUICtrlRead($deadCbox))
	IniWrite(@ScriptDir & "\jreBot.ini", $charName, "usezerkCbox", GUICtrlRead($usezerkCbox))
	IniWrite(@ScriptDir & "\jreBot.ini", $charName, "usegiantCbox", GUICtrlRead($usegiantCbox))
	IniWrite(@ScriptDir & "\jreBot.ini", $charName, "targetgiantCbox", GUICtrlRead($targetgiantCbox))
	IniWrite(@ScriptDir & "\jreBot.ini", $charName, "randomRadio", GUICtrlRead($randomRadio))
	IniWrite(@ScriptDir & "\jreBot.ini", $charName, "centerRadio", GUICtrlRead($centerRadio))
	IniWrite(@ScriptDir & "\jreBot.ini", $charName, "2nd", GUICtrlRead($2ndCbox))
	IniWrite(@ScriptDir & "\jreBot.ini", $charName, "recast", GUICtrlRead($recastInput))
	IniWrite(@ScriptDir & "\jreBot.ini", $charName, "imbue", GUICtrlRead($imbueInput))
	$skill = ""
	For $i = 0 To _GUICtrlListBox_GetCount($attackList) - 1
		$skill &= _GUICtrlListBox_GetText($attackList, $i) & "|"
	Next
	IniWrite(@ScriptDir & "\jreBot.ini", "Settings", "skills", $skill)

	$buff = ""
	For $i = 0 To _GUICtrlListBox_GetCount($buffList) - 1
		$buff &= _GUICtrlListBox_GetText($buffList, $i) & "|"
	Next
	IniWrite(@ScriptDir & "\jreBot.ini", "Settings", "buffs", $buff)

EndFunc

Func Load()
	GUICtrlSetData($xInput, IniRead(@ScriptDir & "\jreBot.ini", "Settings", "x", "" ))
	GUICtrlSetData($yInput, IniRead(@ScriptDir & "\jreBot.ini", "Settings", "y", "" ))
	GUICtrlSetData($rInput, IniRead(@ScriptDir & "\jreBot.ini", "Settings", "range", "100" ))
	GUICtrlSetData($imbueInput, IniRead(@ScriptDir & "\jreBot.ini", "Settings", "imbue", "" ))
	GUICtrlSetData($attackList, IniRead(@ScriptDir & "\jreBot.ini", "Settings", "skills", "" ))
	GUICtrlSetData($buffList, IniRead(@ScriptDir & "\jreBot.ini", "Settings", "buffs", "" ))
	GUICtrlSetState($goldCbox, IniRead(@ScriptDir & "\jreBot.ini", "Settings", "gold", "4"))
	GUICtrlSetState($itemCbox, IniRead(@ScriptDir & "\jreBot.ini", "Settings", "item", "4" ))
	GUICtrlSetState($elixirCbox, IniRead(@ScriptDir & "\jreBot.ini", "Settings", "elixir", "4"))
	GUICtrlSetState($soxCbox, IniRead(@ScriptDir & "\jreBot.ini", "Settings", "sox", "4"))
	GUICtrlSetState($blindCbox, IniRead(@ScriptDir & "\jreBot.ini", "Settings", "blind", "4"))
	GUICtrlSetState($deadCbox, IniRead(@ScriptDir & "\jreBot.ini", "Settings", "dead", "4"))
	GUICtrlSetState($2ndCbox, IniRead(@ScriptDir & "\jreBot.ini", "Settings", "2nd", "4"))
	GUICtrlSetState($zerkCbox, IniRead(@ScriptDir & "\jreBot.ini", "Settings", "zerk", "4"))
	GUICtrlSetData($recastInput, IniRead(@ScriptDir & "\jreBot.ini", "Settings", "recast", "300"))
EndFunc




 


يتصفح الموضوع حالياً : 1 (0 عضو و 1 زائر)
 

ضوابط المشاركة
لا تستطيع إضافة مواضيع جديدة
لا تستطيع الرد على المواضيع
لا تستطيع إرفاق ملفات
لا تستطيع تعديل مشاركاتك

BB code متاحة
كود [IMG] متاحة
كود HTML معطلة

الانتقال السريع

المواضيع المتشابهه
الموضوع كاتب الموضوع المنتدى الردود آخر مشاركة
مشكلة داخل الجيم cres قسم الاستفسارات ومشاكل وحلول ال Sbot 5 11-11-2018 12:39 PM
اسفسارات داخل الجيم : اسم الجيم + اسماء المدن + ازاى اعرف اجيب كود Emely قسم الاسئلة و الاستفسارات لعمل السيرفرات الخاصة 4 03-02-2014 01:27 PM
استفسار داخل الجيم dematreio قسم الاسئلة و الاستفسارات لعمل السيرفرات الخاصة 6 01-11-2013 01:41 AM
طلب من داخل الجيم يوسف النجم قسم الاسئلة و الاستفسارات لعمل السيرفرات الخاصة 4 19-11-2012 05:21 PM


الساعة الآن 07:21 PM.