Bloodyboss Posted August 31, 2010 Report Share Posted August 31, 2010 hey , I have this code in remote on *:input:#:{ if ($1 == !msg) { timer 0 60 /amsg $!+ $!rand(1,12) $!read(wize.txt) } } it reads random lines from the file wize.txt I wanna a code that reads lines in order X-Fusion helped me with this code alias wize { inc %wize.number timer 0 60 amsg $rand(1,12) $read(wize.txt, $+ %wize.number $+ ) } } and in variables ( %wize.number 0 ) but when it works it keeps send the first line in the file wiz.txt to channel I tried alias wize { inc %wize.number timer 0 60 amsg $rand(1,12) $!read(wize.txt, $+ %wize.number $+ ) } } but also it sends the first line only May anyone tells me what's wrong ? err0r 1 Link to comment Share on other sites More sharing options...
err0r Posted August 31, 2010 Report Share Posted August 31, 2010 well you main problem is you have a bracket mismatch alias wize { inc %wize.number timer 0 60 amsg $rand(1,12) $!read(wize.txt, $+ %wize.number $+ ) } } another problem is you would need to change the wize.number each time the timer triggers not just when u start the timer what you are doing is inc the number once then starting a timer that will use that number every time you could use another alias alias wizestart { timer.wize 0 60 wize } alias wize { inc %wize.number amsg $rand(1,12) $!read(wize.txt, $+ %wize.number $+ ) } where you would start it with /wizestart even then once it gets to be more than the lines of the txt file you will have an issue you could start it over at one if the $read on the number didn't exist Link to comment Share on other sites More sharing options...
Bloodyboss Posted August 31, 2010 Author Report Share Posted August 31, 2010 So how would I change the number ??? could it be done by a code ?? Link to comment Share on other sites More sharing options...
err0r Posted August 31, 2010 Report Share Posted August 31, 2010 alias wizestart { set %wize.number 0 | timer.wize 0 60 wize } alias wize { inc %wize.number $iif(!$read(wize.txt,%wize.number),set %wize.number 1) amsg $+ $rand(1,12) $read(wize.txt,%wize.number) } This would account for number of lines issue i mentioned above. You would start it by /wizestart Link to comment Share on other sites More sharing options...
Bloodyboss Posted August 31, 2010 Author Report Share Posted August 31, 2010 yup it worked good - thank you err0r (Y) Link to comment Share on other sites More sharing options...
err0r Posted August 31, 2010 Report Share Posted August 31, 2010 you're welcome Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now