Jump to content

Run Number Counter


Recommended Posts

hey... i read basicly everything in the help and tried to find it on the forums but i cant... i need the code that counts how many times an expression has been used or in other words how many times the script looped

anyone help me out on this?

Link to comment
Share on other sites

A basic example

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

$i=0
While 1
    $i=$i+1
    MsgBox(0, "Loop No", $i)
    Sleep (100)
WEnd

Func Terminate()
    Exit 0
EndFunc


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

hey... i read basicly everything in the help and tried to find it on the forums but i cant... i need the code that counts how many times an expression has been used or in other words how many times the script looped

anyone help me out on this?

Do you want it to count as it loops, or put a limit on how many times it loops?

For first one maybe

Dim $_1
While $_1 <*whatever you normal loop is*
;Script here
Tooltip($_1,0,0)
$_1=$_1+1
Wend

if its the second one try this

while $i <*loop count*
;What to loop
$i=$i+1
Wend

EDIT

Ahhhhh beat twice

Edited by Paulie
Link to comment
Share on other sites

arg... still cant get it to work.... alright this is what i want it to do... i need it to count how many times it runs the do till until.. and save that loop number to a file (counter) and then i need it to retreave that number to know what line to read in the password file..

for example:loop number is 32

32 is then written and saved in counter.txt

32 is then read from counter.txt

reads line 32 from password.ini

types in line 32 of password.ini wherever it says $password

dim $password, $username, $pass, $1, $homechannel, $count, $loop



 FileOpen ("C:\Program Files\StealthBot\Counter.txt",2)
 $count=FileWrite("C:\Program Files\StealthBot\Counter.txt",$loop)
      
$loop = 0
Do
$loop = $loop +1 
Until $loop = 10

    
Hotkeyset("{Esc}", "Quit")
func quit()
exit
endfunc

 $Username=FileReadLine("C:\Program Files\StealthBot\Account.ini")
 $homechannel=FileReadLine("C:\Program Files\StealthBot\Account.ini")



Do
Run("StealthBot v2.6R3.exe")
WinWaitActive("[Disconnected] - StealthBot v2.6 Revision 3")
;opens settings
Send("^p")
WinWaitActive("StealthBot Settings")
;selects username box
MouseClick("left", 420, 324, 2)
Sleep (200)
;types in username
Send($username,4)
;selects password box
MouseClick("left", 433, 365, 2)
;types in password
  $password=FileReadLine("C:\Program Files\StealthBot\password.ini")
send($password,$loop)
;types homechannel
Send($homechannel,6)
;applies settings
MouseClick("left", 773, 548, 1)
;opens bot menu
MouseClick("left", 11, 49, 1)
;selects connect
MouseClick("left", 38, 70, 1)

WinWaitActive("[$username, online in channel $homechannel] -stealthbot v2.6", "", 5)
If WinExists ("[Disconnected] - StealthBot v2.6 Revision 3") Then ProcessClose ("StealthBot v2.6R3.exe")
Until WinExists ("[$username, online in channel $homechannel] -stealthbot v2.6")
Link to comment
Share on other sites

should work idk

#include <file.au3>
Hotkeyset("{Esc}", "Quit")
dim $password, $username, $pass, $1, $homechannel, $count, $loop


_FileCreate(@ProgramFilesDir & "\StealthBot\Account.ini")
$file = @ProgramFilesDir & "\StealthBot\Account.ini"
IniWrite($file,"Info","Username","YOURUSERNAME")
IniWrite($file,"Info","Channel","YOURCHANNEL")
IniWrite($file,"Info","Password","YOURPASSWORD")
FileOpen ("C:\Program Files\StealthBot\Counter.txt",2)

      
$loop = 0
Do
$loop = $loop +1
Until $loop = 10
$count=FileWrite("C:\Program Files\StealthBot\Counter.txt",$loop)

$Username = IniRead($file,"Info","Username","")
$homechannel=IniRead($file,"Info","Channel","")


Do
Run("StealthBot v2.6R3.exe")
WinWaitActive("[Disconnected] - StealthBot v2.6 Revision 3")
;opens settings
Send("^p")
WinWaitActive("StealthBot Settings")
;selects username box
MouseClick("left", 420, 324, 2)
Sleep (200)
;types in username
Send($username,4)
;selects password box
MouseClick("left", 433, 365, 2)
;types in password
send(IniRead($file,"Password","Password",""),$loop)
;types homechannel
Send($homechannel,6)
;applies settings
MouseClick("left", 773, 548, 1)
;opens bot menu
MouseClick("left", 11, 49, 1)
;selects connect
MouseClick("left", 38, 70, 1)

WinWaitActive("[" & $password & ", online in channel" & $homechannel & "] -stealthbot v2.6", "", 5)
If WinExists ("[Disconnected] - StealthBot v2.6 Revision 3") Then ProcessClose ("StealthBot v2.6R3.exe")
Until WinExists ("[" & $password & ", online in channel" & $homechannel & "] -stealthbot v2.6")

func quit()
exit
endfunc
Link to comment
Share on other sites

_FileCreate(@ProgramFilesDir & "\StealthBot\Account.ini")
$file = @ProgramFilesDir & "\StealthBot\Account.ini"
IniWrite($file,"Info","Username","YOURUSERNAME")
IniWrite($file,"Info","Channel","YOURCHANNEL")
IniWrite($file,"Info","Password","YOURPASSWORD")
FileOpen ("C:\Program Files\StealthBot\Counter.txt",2)

is the only part i dont really understand with what you did... just a couple ?s......

1.i already have the file account.ini made... is this going to make a new one? and everytime it runs is it going to make a new file?

2. for the InI writes, im not understanding what its going to do... i just need it to retrieve the username and homechannel from the account.ini file (and i successfully did that with the old script) is this going to be editing the ini file or is it still goin to retrieve the same information like the old script did for the username and homechannel

Link to comment
Share on other sites

just type in your username channel and password itll be all good dont worry, you were using a .ini and doing a fileread yeah so theres no point this is going to check if it exists but delete your other one first

#include <file.au3>
Hotkeyset("{Esc}", "Quit")
dim $password, $username, $pass, $1, $homechannel, $count, $loop

If Not FileExists(@ProgramFilesDir & "\StealthBot\Account.ini") Then
_FileCreate(@ProgramFilesDir & "\StealthBot\Account.ini")
$file = @ProgramFilesDir & "\StealthBot\Account.ini"
IniWrite($file,"Info","Username","YOURUSERNAME")
IniWrite($file,"Info","Channel","YOURCHANNEL")
IniWrite($file,"Info","Password","YOURPASSWORD")
FileOpen ("C:\Program Files\StealthBot\Counter.txt",2)
EndIf
      
$loop = 0
Do
$loop = $loop +1
Until $loop = 10
$count=FileWrite("C:\Program Files\StealthBot\Counter.txt",$loop)

$Username = IniRead($file,"Info","Username","")
$homechannel=IniRead($file,"Info","Channel","")


Do
Run("StealthBot v2.6R3.exe")
WinWaitActive("[Disconnected] - StealthBot v2.6 Revision 3")
;opens settings
Send("^p")
WinWaitActive("StealthBot Settings")
;selects username box
MouseClick("left", 420, 324, 2)
Sleep (200)
;types in username
Send($username,4)
;selects password box
MouseClick("left", 433, 365, 2)
;types in password
send(IniRead($file,"Password","Password",""),$loop)
;types homechannel
Send($homechannel,6)
;applies settings
MouseClick("left", 773, 548, 1)
;opens bot menu
MouseClick("left", 11, 49, 1)
;selects connect
MouseClick("left", 38, 70, 1)

WinWaitActive("[" & $password & ", online in channel" & $homechannel & "] -stealthbot v2.6", "", 5)
If WinExists ("[Disconnected] - StealthBot v2.6 Revision 3") Then ProcessClose ("StealthBot v2.6R3.exe")
Until WinExists ("[" & $password & ", online in channel" & $homechannel & "] -stealthbot v2.6")

func quit()
exit
endfunc
Link to comment
Share on other sites

to the word that is the next on the list in password.ini...... its very complitcated to explain so ill try again

1.counter saves a number to counter.ini (say its the 32nd time its looping so in counter.ini it would put 32)

2. the script then reads counter.ini, and takes the number that is put in there (32)

3. then takes 32, and reads the line of 32 of password.ini (a list of passwords)

4. then next loop the counter would say 33, save it to counter.ini and then read line 33 of password.ini....

and it keeps goin and goin

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...