Jump to content

startup script not working?


Guest ragecrow
 Share

Recommended Posts

Guest ragecrow

I am having a problem getting this script to re-open the .exe it closes.

Code looks like this

; --------------------------------- Vars's -----------------------------------

$botting=0

$AppName=IniRead("botting.ini","Settings","App_Name","turnbot.exe")

$start_key=IniRead("botting.ini","Settings","Hotkey_StartFunc","{DEL}")

$stop_key=IniRead("botting.ini","Settings","Hotkey_StopFunc","{END}")

; --------------------------------- Func's -----------------------------------

Func bot_start()

$botting=1

EndFunc

Func bot_stop()

$botting=0

EndFunc

; --------------------------------- Hotkey's ---------------------------------

HotKeySet($start_key, "bot_start")

HotKeySet($stop_key, "bot_stop")

; --------------------------------- Start ------------------------------------

While 1

if $botting=1 Then

Run($AppName)

WinWaitActive("turnbot v0.67", "OK")

Send("{ENTER}")

EndIf

Sleep(1000)

WEnd

I also have a notepad file named botting.ini in the same directory that looks like this.

[settings]

App_Name=turnbot.exe

Hotkey_StartFunc={DEL}

Hotkey_StopFunc={END}

Essentially I hit delete and it opens the .exe file. That runs for a few minutes and then closes with a pop-up. The script closes the popup but will not re-open the .exe to start the cycle over (what I want). Is there something wrong in the code preventing it from re-opening?

Thanks guys!

Link to comment
Share on other sites

so all u want this script to do is run a program when u hit blah and close it when u hit blah then run it again if u press same key?

try this ?

Run("turnbot.exe")

While 1
HotKeySet("{END}", "Quit")
HotKeySet("{DEL}", "Start")
WEnd

Func Quit()
ProcessClose ("turnbot.exe")
EndFunc

Func Start()
Run("turnbot.exe")
EndFunc

jsut tested with notepad, hope thats want u meant :idiot:

Edited by burrup

qq

Link to comment
Share on other sites

Guest ragecrow

Thank you for the reply. I actually want it to start with the keypress but automatically restart the .exe after it closes the popup. I have a smaller script to do this but i cant get the keypress to turn on and off to work.

Thanks!

Link to comment
Share on other sites

so all u want this script to do is run a program when u hit blah and close it when u hit blah then run it again if u press same key?

try this ?

Run("turnbot.exe")

While 1
HotKeySet("{END}", "Quit")
HotKeySet("{DEL}", "Start")
WEnd

Func Quit()
ProcessClose ("turnbot.exe")
EndFunc

Func Start()
Run("turnbot.exe")
EndFunc

jsut tested with notepad, hope thats want u meant :idiot:

<{POST_SNAPBACK}>

Wouldn't it be better to have the hotkey B4 the while loop?? no reason to repeatedly set it....

ie

HotKeySet("{END}", "Quit")
HotKeySet("{DEL}", "Start")

While 1
Sleep(100)
WEnd
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...