Simple Broadcast script

Release your script here.
State:
- Author
- What it does
- Perhaps a little guide.
- Also, if the snippet is of any use to the community, it has a chance of getting posted on the main page, so don't hesitate to submit/ask!

Simple Broadcast script

Postby Zodac0de » Wed May 06, 2009 2:28 pm

Hello!
It's just a REALLY simple broadcast script :)

Use: .bc help
And you'll see the commands.

Exemple:
<nick>: .bc add 10 3600 Hello world!
<bot notice>: Broadcast added. To delete broadcast use: .bc del <nr>


Don't forget to change NICK to your nick.

Code: Select all
on *:text:.bc*:#: {
  if ($nick == NICK) {
    set %bct $rand(0,1000)
    if (!$2) {
      notice $nick Error. SYNTAX: $1 <help> | halt
    }
    if ($2 == add) {
      if ($3 == 0) {
        .notice $nick Please don't use $3 times, i could get killed. | halt
      }
      .timer [ $+ [ %bct ] ] $3 $4 .amsg (Broadcast) $5-
      .notice $nick Broadcast added. To delete broadcast use: .bc del %bct
    }
    if ($2 == del) {
      if (!$3) {
        .notice $nick Error. Syntax: $1 $2 <nr> | halt
      }
      .timer [ $+ [ $3 ] ] off
      .notice $nick Broadcast deleted.
    }
  }
  if ($2 == help) {
    notice $nick SYNTAX: $1 <add|(del> <nr>) <howmanytimes> <howoften(in seconds)> <your massage>
    Notice $nick  $1 add
    notice $nick <howmanytimes> = How many times you want it to broadcast.
    notice $nick <howoften(in seconds)> = How often you like it to send you broadcast massage.
    notice $nick  $1 del
    notice $nick <nr> = The number you got when you addded the broadcasting massage.
    | halt
  }
}
else {
  notice $nick You don't have access to this command.
}
Last edited by Zodac0de on Mon May 11, 2009 1:35 pm, edited 4 times in total.
Zodac0de
 

Re: Simple Broadcast script

Postby Cristian » Wed May 06, 2009 5:01 pm

Hi

I loaded the script in my mirc editor, and it seems like there is some misplaced brackets.

This line isn't the best to use on Quakenet.
Code: Select all
if ($nick == NICK) {


The script is okay, simple to use.

Commands can be found by typing ".bc help".
Cristian
proof of advance
proof of advance
 
Posts: 282
Joined: Sun Nov 04, 2007 3:02 pm
Location: Denmark
Authnick: Sumsar

Re: Simple Broadcast script

Postby StareX » Tue Jun 02, 2009 6:06 am

Very nice.. :)

Thanks! ;)
StareX
 

Re: Simple Broadcast script

Postby zNigel- » Tue Jun 02, 2009 11:01 am

Sumsar wrote:This line isn't the best to use on Quakenet.
Code: Select all
if ($nick == NICK) {




Exactly..

That's why i'm learning my coding with
Code: Select all
  if ($read(users.txt,w,$address($nick,2)))

witch reads the file users.txt for your *!*@host :)

Imo it's much safer than the $nick == nick shizzle for beginners
zNigel-
 

Re: Simple Broadcast script

Postby Cristian » Tue Jun 02, 2009 2:27 pm

zNigel wrote:
Sumsar wrote:This line isn't the best to use on Quakenet.
Code: Select all
if ($nick == NICK) {




Exactly..

That's why i'm learning my coding with
Code: Select all
  if ($read(users.txt,w,$address($nick,2)))

witch reads the file users.txt for your *!*@host :)

Imo it's much safer than the $nick == nick shizzle for beginners


We all have to start somewhere ;)

and the .amsg command might be useless after Quakenets update, I'm talking about channelmode +T, its something to take under consideration when updating the script.
Cristian
proof of advance
proof of advance
 
Posts: 282
Joined: Sun Nov 04, 2007 3:02 pm
Location: Denmark
Authnick: Sumsar

Re: Simple Broadcast script

Postby zNigel- » Tue Jun 02, 2009 3:05 pm

Sumsar wrote:
We all have to start somewhere ;)

and the .amsg command might be useless after Quakenets update, I'm talking about channelmode +T, its something to take under consideration when updating the script.



RAW should still work tho ^^
zNigel-
 

Re: Simple Broadcast script

Postby Blady » Thu Jul 23, 2009 2:11 pm

What about a command to list all the <nr> running ? For example if you forgot them =)
Blady
 

Re: Simple Broadcast script

Postby Jerzy » Thu Jul 23, 2009 2:26 pm

Blady: Exactly as i was going to say.

It could maybe be a good idea to just have the cmd: .bc add 3600 Hello world! and not: .bc add 10 3600 Hello world!
so you dont need to type the number yourself, but the bot just do it for you.
Jerzy
 

Re: Simple Broadcast script

Postby Zodac0de » Fri Jul 24, 2009 10:11 am

Jerzy wrote:Blady: Exactly as i was going to say.

It could maybe be a good idea to just have the cmd: .bc add 3600 Hello world! and not: .bc add 10 3600 Hello world!
so you dont need to type the number yourself, but the bot just do it for you.



So it will be default with 10 times? =)

and with the number list, dont know how to make it..

// $me
Zodac0de
 

Re: Simple Broadcast script

Postby Blady » Mon Aug 17, 2009 3:12 pm

Zodac0de wrote:
Jerzy wrote:Blady: Exactly as i was going to say.

It could maybe be a good idea to just have the cmd: .bc add 3600 Hello world! and not: .bc add 10 3600 Hello world!
so you dont need to type the number yourself, but the bot just do it for you.


So it will be default with 10 times? =)

// $me


Maybe make something : if the user type : .bc add <delay> <msg> (So when he does not provide a number of times), use '0' for unlimited messages :)

The check can be done like :
Code: Select all
if ($1 == .bc) {
  if ($2 == add) {
    if ($4 isnum) {
      var %message = $5-
      var %delay = $4
      var %numTimes = $3
    }
    else {
      var %message = $4-
      var %delay = $3
      var %numTimes = 0
    }
    .timer [ $+ [ %bct ] ] %numTimes %delay .amsg (Broadcast) %message
  }
}




Zodac0de wrote:
Jerzy wrote:and with the number list, dont know how to make it..
// $me


To do it, you can add an index to all the timer. Instead of:
Code: Select all
.timer [ $+ [ %bct ] ] <numTimes> <delay> <command>

Use:
Code: Select all
.timerbc. [ $+ [ %bct ] ] <numTimes> <delay> <command>


And then, use the $timer function like :
Code: Select all
var %i = 1, %timedMessage = 0
while ($timer(%i)) {
  if (bc.* iswm $v1) {
    .timer 1 %timedMessage notice $nick BC LIST - Name: $timer(%i).name - Time before next spam: $timer(%i).secs - Message: $gettok($timer(%i).com,$2-,32)
    inc %timedMessage 2
  }
  inc %i
}
.timer 1 %timedMessage I found $calc(%timedMessage / 2) timer(s) running.



Regards.
Blady
 

Next

Return to Mirc Scripting Release

Who is online

Users browsing this forum: No registered users and 0 guests