|
markspec87
|
markspec87
|
hey, im new to doing these mirc scripts, and have had a go at modyfying a bot. ive managed to get it to idle in ppls channels on !idle #mychan.
Now i was wondering if theres anyway way i can add to that bit of code, so it adds that channel to the perform list. So it will always join it, without users having to do the command over and over.
I was also interested in finding out if you can message all the channels your in with the same message, say every 15 mins.
Hope someone can help :0
thanks
Last edited by markspec87; 29/11/05 04:47 PM.
|
|
|
|
schaefer31
|
schaefer31
|
alias sayall {
.timersayall 0 900 amsg $$1-
} Useage: /sayall your messageTo disable: /timersayall off The 0 specifies the timer never ends, unless you disconnect or close mIRC. The 900 is 15 minutes (in seconds).
|
|
|
|
schaefer31
|
schaefer31
|
on 1:text:!idle *:*:{
if ($left($2,1) == $chr(35) && $len($2) > 1) {
if ($me ison $2) {
.notice $nick I'm already on $2 $+ !
}
else {
join $2
idlechan.add $2
}
}
else if ($2 == add && $3 != $null) {
idlechan.add $3
}
else if ($2 == del && $3 != $null) {
idlechan.del $3
}
else if ($2 == show) {
idlechan.show
}
else {
.notice $nick $2 is not a channel!
}
}
alias idlechan {
if ($read(joins.txt) == $null) {
return
}
else {
join $read(joins.txt,p)
}
}
alias idlechan.del {
if ($read(joins.txt,1) == $null) {
.notice $nick No channels exist!
}
else {
var %del = $replace($read(joins.txt),$chr(44),$chr(32))
if ($istok(%del,$1,32)) {
write -l1 joins.txt $replace($deltok(%del,$findtok(%del,$1,1,32),32),$chr(32),$chr(44))
.notice $nick $1 was removed from the list.
if ($me ison $1) {
part $1
}
}
else { .notice $nick $1 is not in the list. }
}
}
alias idlechan.add {
if ($read(joins.txt,1) == $null && $left($1,1) == $chr(35)) {
write -l1 joins.txt $1
.notice $nick $1 was added to the list.
}
else if ($read(joins.txt,1) != $null && $left($1,1) == $chr(35)) {
var %exists = $replace($read(joins.txt),$chr(44),$chr(32))
if ($istok(%exists,$1,32)) {
.notice $nick $1 already exists!
}
else {
write -al1 joins.txt $+($chr(44),$1)
.notice $nick $1 was added to the list.
}
}
else {
.notice $nick $1 is not a channel!
}
}
alias idlechan.show {
if ($read(joins.txt,1) == $null) {
.notice $nick No channels exist!
}
else {
.notice $nick $replace($read(joins.txt),$chr(44),$chr(32))
}
}
Edit: Found I had a mismatched bracket. * Code not testedThis uses a text file joins.txt instead of the perform list. Useage !idle #channel This will add #channel to the idle list and join #channel !idle add #channel Same as previous command, but it doesn't join the channel !idle del #channel Removes #channel from the idle list and parts #channel !idle show Shows a list of current channels in the idle list To add it to perform add a line with just "idlechan" Note: There has to be channels in the list, obviously or it won't do anything.
|
|
|
|
markspec87
|
markspec87
|
alias sayall {
.timersayall 0 900 amsg [color:red]your message[/color]
} Useage: /sayall your messageTo disable: /timersayall off The 0 specifies the timer never ends, unless you disconnect or close mIRC. The 900 is 15 minutes (in seconds). cant seem to get that working. I need a script that i can put in my config and then itll just do it automatically (i specify the message in the config). maybe im doing something wrong.
|
|
|
|
schaefer31
|
schaefer31
|
The code goes in your remote scripts. Press Alt +R, then File > New and paste the code. If you want to add it to perform, then add this line
sayall your message
|
|
|
|
Joined: Nov 2005
Posts: 104
Vogon poet
|
Vogon poet
Joined: Nov 2005
Posts: 104 |
I believe that code should be
alias sayall { /set %timersay $$1- | /timersayall 0 900 /amsg %timersay }
with the usage being /sayall Your Message Here and to disable will still be /timersayall off. That's using the code you where already provided. Just adding a variable so the usage would work.
|
|
|
|
schaefer31
|
schaefer31
|
Oops. Yeah, it should have been $$1-. The slashes aren't necessary, though.
|
|
|
|
markspec87
|
markspec87
|
hmmm getting confused (srroy) what ive got is this: alias sayall .timersayall 0 20 amsg 2 #mychan Idle and perform! this works but it puts an extra } on the end. E.g. it says in channels "#mychan Idle and perform!}" Can anyone tell me how to sort that? And my text colouring doesnt work for some reason Hope you can help me 
Last edited by markspec87; 30/11/05 11:04 PM.
|
|
|
|
schaefer31
|
schaefer31
|
I don't know if you're aware but the second value in the timer is the amount of time between executing the command in seconds. In your above example you're using '0 20' so it will repeat every 20 seconds. That's probably not a good idea. Put this in your remotes (alt+r) and do not modify it in any way unless you want to change the time delay (900seconds / 15 minutes). alias sayall {
.timersayall 0 900 echo -a $$1-
} Then after you have done this, type: /sayall #mychan Idle and perform! This will start a timer and send the message to every channel you're in at 15 minute intervals. Also, the code I posted for your idle/joining should be functional. I made a couple changes to it. That code also goes in your remotes.
|
|
|
|
markspec87
|
markspec87
|
ive added to my script but it doesnt do anything.  Tested it on 1 second etc still nothing.
|
|
|
|
Joined: Dec 2002
Posts: 1,245
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,245 |
you might post your script here so we can have a bettter idea of why it isnt working
|
|
|
|
markspec87
|
markspec87
|
the one above my post ^^ 
|
|
|
|
Joined: Dec 2002
Posts: 1,245
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,245 |
ive added to my script but it doesnt do anything.
show what you added it to, don't be obtuse
alias awayflud { .timer-msgaway 0 900 amsg $chr(3) $+ 2 $$1- } alias awayback { .timer-msgaway off }
useage /awayflud (your reason here) /awayback (no other input needed)
|
|
|
|
markspec87
|
markspec87
|
what are you on about?? i make a file called "script.mrc" and put the code in alias sayall {
.timersayall 0 900 echo -a $$1-
} But i when i do /sayall test Nothing happens. Even if i reduce time to 2 seconds nothing happens... 
Last edited by markspec87; 01/12/05 07:13 PM.
|
|
|
|
Joined: Dec 2002
Posts: 1,245
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,245 |
well it worked here... it took 15 minutes, but worked. so is there anything else in the script? or is that the only thing in it?
alias sayall { away $$1- amsg I'm Away: $$1- .timersayall 0 900 amsg I'm Away: $$1- }
|
|
|
|
Joined: Nov 2005
Posts: 104
Vogon poet
|
Vogon poet
Joined: Nov 2005
Posts: 104 |
Give this option a try. If you do it correctly, nothing can go wrong. First hit Alt + R, then go to File - New. Next paste the following code
menu menubar,status,nicklist,query,channel {
Msg Timer
.Start Message:{ set %t.message $$?="Enter Message To Display" | set %t.seconds $$?="How Many Seconds Between Displays" | timerMsg 0 %t.seconds amsg %t.message }
.Stop Message: { timerMSG off }
}
The usage is simply right clicking in the channel/menubar/status finding the Msg Timer tab, and then clicking Start Msg. You'll get a couple popup's asking for the message to display, and then how many seconds you want the messages to be apart. You're also able to use ctrl + k in the message prompt to add color. When you want to halt the timer, simply click Stop Message. Hope this does what you're wanting. And if you have any further problems, just reply.
|
|
|
|
markspec87
|
markspec87
|
it works but the whole point of loking for this script was so that i didnt have to anything manually. I.e i put the script in file, define the message i want in the file aswell, then it works automaticly. Or with a simple sayall command. Any other ideas why it wont work? thanks for helping as well, didnt expect so many responses 
|
|
|
|
Joined: Nov 2005
Posts: 104
Vogon poet
|
Vogon poet
Joined: Nov 2005
Posts: 104 |
what are you on about?? i make a file called "script.mrc" and put the code in alias sayall {
.timersayall 0 900 echo -a $$1-
} But i when i do /sayall test Nothing happens. Even if i reduce time to 2 seconds nothing happens... for one, you have that /echoing and not /amsgin.
alias startsay { set %t.msg $$1- | timermsg 0 900 amsg %t.msg }
alias stopsay { timermsg off }
The usage would be /startsay message to begin the message, and /stopsay to stop the message. If you'd like to change the seconds between the messages, simply change the 900 to your desired length in seconds. Leave the 0 as it is. I changed the alias's in case you still have some of the other's loaded which could be causing a problem. Hope this works for you.
|
|
|
|
Joined: Nov 2005
Posts: 104
Vogon poet
|
Vogon poet
Joined: Nov 2005
Posts: 104 |
Awesome, Not a problem at all. I honestly don't see why any of the code's listen above didn't work. Just glad it's working for you now though.
|
|
|
|
|