Sign in to follow this  
Followers 0
Lezuric

Pet Eden Script

3 posts in this topic

Is there a new script for Pet Eden? www.l2021.com/bbs

I got an old one. but it doesnt work anymore.

CODE
#include <GUIConstants.au3>

#include <IE.au3>

#include <File.au3>

$oIE = ObjCreate("Shell.Explorer.2")

$GUI_PetEden = GUICreate ("Pet eden", 720, 560,193, 125)

$GUIActiveX = GUICtrlCreateObj ( $oIE, 10, 10 , 700 , 500 )

$GUI_Button_Setup = GuiCtrlCreateButton ("Setup", 10, 520, 100, 30)

$GUI_Button_MyPet = GuiCtrlCreateButton ("My Pet", 120, 520, 100, 30)

$GUI_Button_Adventure = GuiCtrlCreateButton ("Adventure", 230, 520, 100, 30)

$GUI_Button_Warehouse = GuiCtrlCreateButton ("Warehouse", 340, 520, 100, 30)

$GUI_Button_Start = GuiCtrlCreateButton ("Start", 500, 520, 100, 30)

$GUI_Button_Stop = GuiCtrlCreateButton ("Stop", 610, 520, 100, 30)

GUISetState () ;Show GUI

$oIE.navigate("http://www.l2021.com/bbs/pet.php?index=mypet")

While 1

$msg = GUIGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

Exit

Case $msg = $GUI_Button_Setup

Setup()

Case $msg = $GUI_Button_MyPet

$oIE.navigate("http://www.l2021.com/bbs/pet.php?index=mypet")

Case $msg = $GUI_Button_Adventure

$mapid_get = IniRead("data.ini", "Pet Eden", "mapid", "")

$oIE.navigate("http://www.l2021.com/bbs/pet.php?index=petpknpc&mapid=" & $mapid_get)

Case $msg = $GUI_Button_Warehouse

$oIE.navigate("http://www.l2021.com/bbs/pet.php?index=usershop")

Case $msg = $GUI_Button_Start

$mapid = IniRead("data.ini", "Pet Eden", "mapid", "")

$monsterlevel = IniRead("data.ini", "Pet Eden", "monsterlevel", "")

GUICtrlSetState($GUI_Button_Setup, $GUI_DISABLE)

GUICtrlSetState($GUI_Button_MyPet, $GUI_DISABLE)

GUICtrlSetState($GUI_Button_Adventure, $GUI_DISABLE)

GUICtrlSetState($GUI_Button_Warehouse, $GUI_DISABLE)

GUICtrlSetState($GUI_Button_Start, $GUI_DISABLE)

StartBot($mapid, $monsterlevel)

EndSelect

Wend

GUIDelete ()

Exit

Func StartBot($id, $max)

While 1

$msg = GUIGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

ExitLoop

Case $msg = $GUI_Button_Stop

GUICtrlSetState($GUI_Button_Setup, $GUI_ENABLE)

GUICtrlSetState($GUI_Button_MyPet, $GUI_ENABLE)

GUICtrlSetState($GUI_Button_Adventure, $GUI_ENABLE)

GUICtrlSetState($GUI_Button_Warehouse, $GUI_ENABLE)

GUICtrlSetState($GUI_Button_Start, $GUI_ENABLE)

Return

EndSelect

$oIE.navigate("http://www.l2021.com/bbs/pet.php?index=petpknpc&mapid=" & $id)

_IELoadWait($oIE)

$body = _IEBodyReadText($oIE)

If StringInStr($body, "Your pet is dead, can it still fight?") Then

$oIE.navigate("http://www.l2021.com/bbs/pet.php?index=usershop&action=list&itemtype=7")

_IELoadWait($oIE)

$oIE.navigate("http://www.l2021.com/bbs/pet.php?index=itemuse&storageid=436560")

_IELoadWait($oIE)

$oIE.navigate("http://www.l2021.com/bbs/pet.php?index=petpknpc&mapid=" & $id)

_IELoadWait($oIE)

EndIf

$fopen = FileOpen("log.txt", 2)

FileWrite($fopen, $body)

FileClose($fopen)

$fread = FileOpen("log.txt", 0)

$readmonsterline = FileReadLine($fread, 9)

$splitmonsterlevel = StringSplit($readmonsterline, " ") ; $splitmonsterlevel[2] = Level

$readhpline = FileReadLine($fread, 12)

$splithp = StringSplit($readhpline, " ")

If $splitmonsterlevel[2] = $max OR $splitmonsterlevel[2] < $max Then

While $splithp[2] > 0

_IEImgClick($oIE, "http://www.l2021.com/bbs/images/pet/skill/commonf.jpg")

If @error Then

ExitLoop

;~ The monster is dead, search another one

EndIf

_IELoadWait($oIE)

WEnd

EndIf

;~ MsgBox(0, "",) ; read level

WEnd

EndFunc

Func Setup()

$inifile = "data.ini"

$getmonsterlevel = IniRead($inifile, "Pet Eden", "monsterlevel", "")

$getmapid = IniRead($inifile, "Pet Eden", "mapid", "")

$setup = GUICreate("p.e. setup", 175, 263, 302, 174)

$Label1 = GUICtrlCreateLabel("Max. Monster Level: ", 8, 10, 103, 17)

$Label2 = GUICtrlCreateLabel("Map ID: (max 12)", 8, 50, 90, 17)

$mapid = GUICtrlCreateInput($getmapid, 112, 48, 57, 21)

$maxmonsterlvl = GUICtrlCreateInput($getmonsterlevel, 112, 8, 57, 21)

$mapidlist = GUICtrlCreateList("", 8, 72, 161, 162)

GUICtrlSetData(-1, "1: Borbon Lv 1~10|2: Sunset Canyon Lv10~50|3: Hungriness Lv50~90|4: Oblivion Lv90~130|5: Dust Lane Lv130~170|6: Babylon Lv170~220|7: Flaming Desert ?|8: Desert Fortess ?|9: Underground ?")

GUICtrlSetState(-1, $GUI_DISABLE)

$savesetup = GUICtrlCreateButton("save", 96, 240, 75, 17, 0)

GUISetState(@SW_SHOW)

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

GUIDelete($setup)

ExitLoop

Case $savesetup

IniWrite($inifile, "Pet Eden", "monsterlevel", GUICtrlRead($maxmonsterlvl))

IniWrite($inifile, "Pet Eden", "mapid", GUICtrlRead($mapid))

GUIDelete($setup)

ExitLoop

EndSwitch

WEnd

EndFunc

Thanks and Regards!

Share this post


Link to post
Share on other sites



It would help if you said what goes wrong, what errors you have, what version of AutoIt you are using and maybe what OS.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

umm.. there is a latest version of Pet Eden.. I use Autoitv3.. the problem is.. there is a Verification every 2mins. I dont how to deal with it.. speacially im noob doin scripts.. please elp.. thx thx thx!! ^^

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