Hung Le 0 Posted February 22, 2012 Report Share Posted February 22, 2012 Hello, 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! Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted February 22, 2012 Report Share Posted February 22, 2012 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. Quote Link to post Share on other sites
odeesuba 24 Posted February 22, 2012 Report Share Posted February 22, 2012 Here is an idea... 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. Quote Link to post Share on other sites
JohnB 255 Posted February 22, 2012 Report Share Posted February 22, 2012 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 Quote Link to post Share on other sites
rumen 3 Posted February 22, 2012 Report Share Posted February 22, 2012 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. Quote Link to post Share on other sites
Hung Le 0 Posted February 22, 2012 Author Report Share Posted February 22, 2012 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.Thanks guys for all the ideas, that should give me something to work with! 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! Quote Link to post Share on other sites
a2mateit 395 Posted February 22, 2012 Report Share Posted February 22, 2012 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... Quote Link to post Share on other sites
k1lv9h 76 Posted February 23, 2012 Report Share Posted February 23, 2012 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 3 Quote Link to post Share on other sites
JohnB 255 Posted February 23, 2012 Report Share Posted February 23, 2012 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 Quote Link to post Share on other sites
sforzando 0 Posted February 24, 2012 Report Share Posted February 24, 2012 Thanks k1lv9h, works like a charm! +1 Quote Link to post Share on other sites
Hung Le 0 Posted February 24, 2012 Author Report Share Posted February 24, 2012 Hell, can anyone help me, I only have standard edition of Ubot, and I dont understand the code. Can anyone explain it for me so I can apply with standard edition? This look so much simpler than my current method. Quote Link to post Share on other sites
k1lv9h 76 Posted February 24, 2012 Report Share Posted February 24, 2012 The bot.task-count.ubot Kevin 2 Quote Link to post Share on other sites
Hung Le 0 Posted February 25, 2012 Author Report Share Posted February 25, 2012 Thanks a bunch, Kevin! +1 Quote Link to post Share on other sites
Chainsaw 9 Posted February 26, 2012 Report Share Posted February 26, 2012 Wow, very nice Kevin. Thanks for sharing the code, very useful. Quote Link to post Share on other sites
Bliss 194 Posted March 10, 2012 Report Share Posted March 10, 2012 Thanks for sharing with us. Cheers Kevin Jane Quote Link to post Share on other sites
satya17 3 Posted March 16, 2012 Report Share Posted March 16, 2012 Thanks k1lv9h +1 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.