How to limit to run only 1 compiled bot instant at a time
#1
Posted 22 February 2012 - 06:09 AM
I am making a bot to auto commenting on forum. But I don't want user to have the ability to run multiple instant of bot at the same time, to keep them from abusing the bot and attract to much attention.
Right now, anyone can open multiple instant of compiled bot. Is there anyway to limit them to only able to run 1 instant of bot?
Thanks guys!
#2
Posted 22 February 2012 - 07:13 AM
but the bad side to this is that if they prematurely end the process of the bot, and the end part of the bot doesnt delete the file, then it could cause the next instance to not run.
#3
Posted 22 February 2012 - 07:13 AM
At the start of the bot
If file exists
stop the bot
Else
write the file to hard disk
At the end of bot delete the file.
#4
Posted 22 February 2012 - 09:13 AM
you could write a file to a hidden area on the pc, that the bot is running, and have the bot check in teh beginning if it exists, and if so dont run.
but the bad side to this is that if they prematurely end the process of the bot, and the end part of the bot doesnt delete the file, then it could cause the next instance to not run.
You could overcome this by adding a ui button that deletes the file and call it "reset" or something like that.
John
#5
Posted 22 February 2012 - 09:57 AM
#6
Posted 22 February 2012 - 10:11 AM
Thanks guys for all the ideas, that should give me something to work with!Smarter way is to check and see how many processes yourexename.exe*32 is running via shell with VBscript on start up.Good news is You can limit how many bots can be run.VBscript can parse a list of processes in a text file and You can count the processes.If You have other questions for this way I will response tomorrow because of 1 post per day restriction of the forum.
I really interested in Rumen's solution, this sound cool! The bad news for me is I don't know VBscript. Looking forward to see it!
#7
Posted 22 February 2012 - 12:15 PM
Smarter way is to check and see how many processes yourexename.exe*32 is running via shell with VBscript on start up.Good news is You can limit how many bots can be run.VBscript can parse a list of processes in a text file and You can count the processes.If You have other questions for this way I will response tomorrow because of 1 post per day restriction of the forum.
Hey Rumen,
You should PM one of the Admin to get your one post a day restriction lifted...
#8
Posted 23 February 2012 - 04:31 AM
set(#countforprogram, "cmd.exe", "Global")
gettaskcount()
define gettaskcount {
set(#countforprogramfile, ".\\task-count-temp.dat", "Global")
shell("cmd.exe /C tasklist | find /I /C \"{#countforprogram}\" >\"{#countforprogramfile}\"")
set(#taskcount, $read file(#countforprogramfile), "Global")
shell("cmd.exe /C del \"{#countforprogramfile}\"")
}
if($comparison(#taskcount, ">=", 2)) {
then {
alert("Stopping. You have to many running.
Current running count is: {#taskcount}")
stop script
}
else {
alert("Running. count is: {#taskcount}")
}
}Kevin
#9
Posted 23 February 2012 - 06:47 AM
You could do something like this:
set(#countforprogram, "cmd.exe", "Global") gettaskcount() define gettaskcount { set(#countforprogramfile, ".\\task-count-temp.dat", "Global") shell("cmd.exe /C tasklist | find /I /C \"{#countforprogram}\" >\"{#countforprogramfile}\"") set(#taskcount, $read file(#countforprogramfile), "Global") shell("cmd.exe /C del \"{#countforprogramfile}\"") } if($comparison(#taskcount, ">=", 2)) { then { alert("Stopping. You have to many running. Current running count is: {#taskcount}") stop script } else { alert("Running. count is: {#taskcount}") } }
Kevin
Very nice. +1
John
#10
Posted 24 February 2012 - 02:10 AM
#11
Posted 24 February 2012 - 04:57 AM
#13
Posted 24 February 2012 - 10:32 PM
#14
Posted 26 February 2012 - 05:53 AM
#15
Posted 10 March 2012 - 12:04 AM
Cheers Kevin
Jane
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users
















