Jump to content

Running script in litestep


Recommended Posts

I'm running litestep which is a replacement for explorer.exe - basically a windows shell..anyways i cant seem to get my script to run in litestep...it ran in explorer.exe before..

here is the main part of the code not including the includes of course

_IEErrorHandlerRegister("MyErrFunc")

Opt("WinTitleMatchMode", 2)

Func MyErrFunc()

sleep(1)

EndFunc

$g_szVersion = ":)"

Global $Paused

global $MinValue = IniRead("Shant.ini", "defaults", "MinValue", "")

global $MaxValue = IniRead("Shant.ini", "defaults", "MaxValue", "")

global $Potionname = IniRead("Shimlar.ini", "defaults", "Potionname", "")

global $iniread = IniRead(@HomeDrive & "\tempdll.ini", "Return", "SHERRACC", "")

global $delay = IniRead("Shant.ini", "defaults", "fdelay", "")

global $delaymove = IniRead("Shant.ini", "defaults", "mdelay", " ")

HotKeySet("F11", "pickup1")

hotkeyset("F12","pickup2")

HotKeySet("{F8}", "Terminate")

HotKeySet("{F9}", "TogglePause")

HotKeySet("{F8}", "captureEsc")

func pickup1()

sleep(2000)

$oStatsFrame = _IEFrameGetObjByName($oIE, 0)

$statsClip = _IEDocReadHTML($oStatsFrame)

Dim $itemname

$value = _StringBetween($statsclip,"<B>Value:</B> ","<BR><B>")

$itemname = _StringBetween($statsclip,"<B><U>" & @CRLF & "<CENTER>","</CENTER>")

If StringInStr($statsclip,"Item Found!",1,1) Then

TakeItem("1")

EndIf

endfunc

func pickup2()

sleep(2000)

$oStatsFrame = _IEFrameGetObjByName($oIE, 0)

$statsClip = _IEDocReadHTML($oStatsFrame)

Dim $itemname

$value = _StringBetween($statsclip,"<B>Value:</B> ","<BR><B>")

$itemname = _StringBetween($statsclip,"<B><U>" & @CRLF & "<CENTER>","</CENTER>")

If StringInStr($statsclip,"Item Found!",1,1) Then

TakeItem("2")

EndIf

endfunc

Func Terminate()

Exit 0

EndFunc

Func captureEsc()

Terminate()

HotKeySet("{F8}")

Send("{F8}")

HotKeySet("{F8}", "captureEsc")

EndFunc

Func TogglePause()

$Paused = NOT $Paused

While $Paused

AdlibDisable()

sleep(100)

ToolTip('Script is paused.',0,0)

WEnd

ToolTip('')

EndFunc

AutoItWinSetTitle($g_szVersion)

Func Attach()

$oIE = _IEAttach("|:.Shantara Online .:|")

If Not $oIE Then

$m = MsgBox(1,"Failed.", "Failed to find window. Try again?")

If $m = 1 Then

Attach()

Else

Exit

EndIf

EndIf

EndFunc

Opt("GUIOnEventMode", 1)

GUICreate("Chris's Shant Script " & $g_szVersion, 250, 200)

GUISetBkColor (0x00ff00)

GUISetState(@SW_SHOW)

GUISetOnEvent($GUI_EVENT_CLOSE, "Terminate")

$background = GUICtrlCreatePic("AU3-2.bmp", 0, 0, 450, 400)

GUICtrlSetState($background, $GUI_DISABLE)

$btn_start = GUICtrlCreateButton("Start ", 10, 30, 80, 30, BitOR($GUI_SS_DEFAULT_BUTTON, $BS_DEFPUSHBUTTON))

GUICtrlSetOnEvent($btn_start, "Start")

$btn_exit = GUICtrlCreateButton("Exit", 10, 70, 80, 30)

GUICtrlSetOnEvent($btn_exit, "Terminate")

$label_min = GUICtrlCreateLabel("Min Value: ", 10, 110, 80, 20)

GUICtrlSetBkColor($label_min, -2)

$input_min = GUICtrlCreateInput("", 10, 130, 80, 20)

GUICtrlSetTip($input_min, "Minimum Value To Pick Up")

$label_max = GUICtrlCreateLabel("Max Value: ", 10, 150, 80, 20)

GUICtrlSetBkColor($label_max, -2)

$input_max = GUICtrlCreateInput("", 10, 170, 80, 20)

GUICtrlSetTip($input_max, "Maximum Value To Pick Up")

$label_Potions = GUICtrlCreateLabel("Potion to pick up: ", 95, 110, 120, 20)

GUICtrlSetBkColor($label_Potions, -2)

$input_Potions = GUICtrlCreateInput("", 95, 130, 140, 20)

GUICtrlSetTip($input_Potions, "Name of potion")

$label_fdelay = GUICtrlCreateLabel("Fdelay : ", 90, 10, 80, 20, $SS_RIGHT)

GUICtrlSetBkColor($label_fdelay, -2)

$input_fdelay = GUICtrlCreateInput("", 170, 7, 40, 20)

GUICtrlSetTip($input_fdelay, "Input fight delay time in milliseconds.")

$label_mdelay = GUICtrlCreateLabel("Mdelay : ", 90, 30, 80, 20, $SS_RIGHT)

GUICtrlSetBkColor($label_mdelay, -2)

$input_mdelay = GUICtrlCreateInput("", 170, 27, 40, 20)

GUICtrlSetTip($input_mdelay, "Input move delay time in milliseconds.")

$oIE = _IEAttach("|:.Shantara Online .:|")

while 1

sleep(1)

WEnd

Func FightAgain()

sleep($delay)

$oFrame = _IEFrameGetObjByName ($oIE, 0)

$oForm = _IEFormGetObjByName($oFrame, "FightAgain")

MacroCheck()

_IEFormSubmit($oForm)

_IELoadWait($oIE,5,5)

EndFunc

func Attack()

sleep($delay)

$oFrame = _IEFrameGetObjByName ($oIE, 0)

$oForm = _IEFormGetObjByName($oFrame, "baction")

MacroCheck()

_IEFormSubmit($oForm)

_IELoadWait($oIE,5,5)

EndFunc

Func MacroCheck()

$oStatsFrame = _IEFrameGetObjByName($oIE, 0)

$statsClip = _IEDocReadHTML($oStatsFrame)

If StringInStr($statsclip,"Macro",1,1) Then

beep(3000,100)

beep(3000,100)

beep(3000,100)

beep(3000,100)

beep(3000,100)

MsgBox(1,"Alert","Mod check! Alert!!",2)

MacroCheck()

EndIf

EndFunc

Func TakeItem($itemSlot = 1)

If Not IsObj($oIE) Then

__IEErrorNotify ("Error", "fornicate", "$_IEStatus_InvalidDataType")

SetError($_IEStatus_InvalidDataType, 1)

Return 0

EndIf

If Not __IEIsObjType ($oIE, "documentContainer") Then

__IEErrorNotify ("Error", "fornicate", "$_IEStatus_InvalidObjectType")

SetError($_IEStatus_InvalidObjectType, 1)

Return 0

EndIf

$oIE.navigate2 ("java script:top.Game.TakeItem.which.value = " & $itemSlot & "; top.Game.TakeItem.submit()")

_IELoadWait($oIE,5,50)

If 1 Then

SetError(@error)

EndIf

sleep(5)

If 1 Then

SetError(@error)

EndIf

SetError($_IEStatus_Success)

EndFunc

Func CheckForPots()

$oStatsFrame = _IEFrameGetObjByName($oIE, 0)

$statsClip = _IEDocReadHTML($oStatsFrame)

Dim $itemname

$value = _StringBetween($statsclip,"<B>Value:</B> ","<BR><B>")

$itemname = _StringBetween($statsclip,"<B><U>" & @CRLF & "<CENTER>","</CENTER>")

If StringInStr($statsclip,"Item Found!",1,1) Then

if StringInStr($itemname[0],"Health",1,1) Then

TakeItem("1")

EndIf

EndIf

If StringInStr($statsclip,"Item Found!",1,2) Then

if StringInStr($itemname[1],"Health",1,1) Then

TakeItem("2")

EndIf

Else

EndIf

EndFunc

Func Start()

$delay = GUICtrlRead($input_fdelay)

GUIdelete()

while 1

FightAgain()

Attack()

CheckForPots()

WEnd

EndFunc

Edited by EscapeTheFate
Link to comment
Share on other sites

Why not including the includes?

If I could just pick up all your code, drop it into an empty AutoIt document, and hit RUN, I would.

I'm not saying I'd be ablke to help, but somone might.

The lack of proper code tags and decent indentation is what put everyone else off.

;o)

(or

nothing is foolproof to the sufficiently talented fool..

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...