mIRC Home    About    Download    Register    News    Help

Print Thread
Adding to perform // Message chans every 15 mins? #136516 29/11/05 04:46 PM
Joined: Nov 2005
Posts: 15
M
markspec87 Offline OP
Pikka bird
OP Offline
Pikka bird
M
Joined: Nov 2005
Posts: 15
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.
Re: Adding to perform // Message chans every 15 mi #136517 29/11/05 05:42 PM
Joined: Aug 2005
Posts: 525
S
schaefer31 Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
Code:
alias sayall {
 .timersayall 0 900 amsg $$1-
}


Useage: /sayall your message
To disable: /timersayall off

The 0 specifies the timer never ends, unless you disconnect or close mIRC.
The 900 is 15 minutes (in seconds).

Re: Adding to perform // Message chans every 15 mi #136518 29/11/05 06:15 PM
Joined: Aug 2005
Posts: 525
S
schaefer31 Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
Code:
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 tested

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

Re: Adding to perform // Message chans every 15 mi #136519 29/11/05 06:41 PM
Joined: Nov 2005
Posts: 15
M
markspec87 Offline OP
Pikka bird
OP Offline
Pikka bird
M
Joined: Nov 2005
Posts: 15
Quote:
Code:
alias sayall {
 .timersayall 0 900 amsg [color:red]your message[/color]
}


Useage: /sayall your message
To 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.

Re: Adding to perform // Message chans every 15 mi #136520 29/11/05 06:48 PM
Joined: Aug 2005
Posts: 525
S
schaefer31 Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
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

Re: Adding to perform // Message chans every 15 mi #136521 29/11/05 06:56 PM
Joined: Nov 2005
Posts: 105
D
drc4 Offline
Vogon poet
Offline
Vogon poet
D
Joined: Nov 2005
Posts: 105
I believe that code should be
Code:
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.

Re: Adding to perform // Message chans every 15 mi #136522 29/11/05 06:59 PM
Joined: Aug 2005
Posts: 525
S
schaefer31 Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
Oops. Yeah, it should have been $$1-. The slashes aren't necessary, though.

Re: Adding to perform // Message chans every 15 mi #136523 30/11/05 11:04 PM
Joined: Nov 2005
Posts: 15
M
markspec87 Offline OP
Pikka bird
OP Offline
Pikka bird
M
Joined: Nov 2005
Posts: 15
hmmm getting confused (srroy)

what ive got is this:

Code:
 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 smile

Last edited by markspec87; 30/11/05 11:04 PM.
Re: Adding to perform // Message chans every 15 mi #136524 01/12/05 03:49 AM
Joined: Aug 2005
Posts: 525
S
schaefer31 Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
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).

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

Re: Adding to perform // Message chans every 15 mi #136525 01/12/05 02:42 PM
Joined: Nov 2005
Posts: 15
M
markspec87 Offline OP
Pikka bird
OP Offline
Pikka bird
M
Joined: Nov 2005
Posts: 15
ive added to my script but it doesnt do anything. frown

Tested it on 1 second etc still nothing.

Re: Adding to perform // Message chans every 15 mi #136526 01/12/05 04:44 PM
Joined: Dec 2002
Posts: 1,245
M
MikeChat Offline
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
you might post your script here so we can have a bettter idea of why it isnt working

Re: Adding to perform // Message chans every 15 mi #136527 01/12/05 05:26 PM
Joined: Nov 2005
Posts: 15
M
markspec87 Offline OP
Pikka bird
OP Offline
Pikka bird
M
Joined: Nov 2005
Posts: 15
the one above my post ^^ smirk

Re: Adding to perform // Message chans every 15 mi #136528 01/12/05 06:26 PM
Joined: Dec 2002
Posts: 1,245
M
MikeChat Offline
Hoopy frood
Offline
Hoopy frood
M
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)

Re: Adding to perform // Message chans every 15 mi #136529 01/12/05 07:09 PM
Joined: Nov 2005
Posts: 15
M
markspec87 Offline OP
Pikka bird
OP Offline
Pikka bird
M
Joined: Nov 2005
Posts: 15
what are you on about??

i make a file called "script.mrc" and put the code in

Code:
 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... frown

Last edited by markspec87; 01/12/05 07:13 PM.
Re: Adding to perform // Message chans every 15 mi #136530 01/12/05 08:34 PM
Joined: Dec 2002
Posts: 1,245
M
MikeChat Offline
Hoopy frood
Offline
Hoopy frood
M
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-
}

Re: Adding to perform // Message chans every 15 mi #136531 01/12/05 08:47 PM
Joined: Nov 2005
Posts: 105
D
drc4 Offline
Vogon poet
Offline
Vogon poet
D
Joined: Nov 2005
Posts: 105
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
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.

Re: Adding to perform // Message chans every 15 mi #136532 01/12/05 09:36 PM
Joined: Nov 2005
Posts: 15
M
markspec87 Offline OP
Pikka bird
OP Offline
Pikka bird
M
Joined: Nov 2005
Posts: 15
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 smile

Re: Adding to perform // Message chans every 15 mi #136533 01/12/05 10:42 PM
Joined: Nov 2005
Posts: 105
D
drc4 Offline
Vogon poet
Offline
Vogon poet
D
Joined: Nov 2005
Posts: 105
Quote:
what are you on about??

i make a file called "script.mrc" and put the code in

Code:
 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... frown

for one, you have that /echoing and not /amsgin.
Code:
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.

Re: Adding to perform // Message chans every 15 mi #136534 02/12/05 02:44 PM
Joined: Nov 2005
Posts: 15
M
markspec87 Offline OP
Pikka bird
OP Offline
Pikka bird
M
Joined: Nov 2005
Posts: 15
ahh works a treat.

Thanks smile smile smile

Re: Adding to perform // Message chans every 15 mi #136535 02/12/05 04:11 PM
Joined: Nov 2005
Posts: 105
D
drc4 Offline
Vogon poet
Offline
Vogon poet
D
Joined: Nov 2005
Posts: 105
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.