Sign in to follow this  
Followers 0
Guest ragecrow

startup script not working?

6 posts in this topic

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!

Share this post


Link to post
Share on other sites

#2 ·  Posted (edited)

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

[u]Old Projects:[/u]A3MORGB2Hex[u]Old Functions:[/u]_TimeAdd/_TimeSub_AddComma_BubbleSort _RippleSort "He who does not understand your silence will probably not understand your words." - Elbert Hubbard.

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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

<{POST_SNAPBACK}>

Exactly.

Share this post


Link to post
Share on other sites

Exactly.

<{POST_SNAPBACK}>

i agree, the reason i done it that way was because i tried it your way closeupman but it did work :idiot: , i think it is because i was using ProcessClose instead of WinClose.

thanks


[u]Old Projects:[/u]A3MORGB2Hex[u]Old Functions:[/u]_TimeAdd/_TimeSub_AddComma_BubbleSort _RippleSort "He who does not understand your silence will probably not understand your words." - Elbert Hubbard.

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