;------------------------
;Bloodbath
;------------------------
on *:TEXT:!startmessage:#bloodbath102: {
if ($nick isop #) {
msg $chan Message cycle is now starting.
.timerLinks 0 600 .play # E:\Twitch\BeckonedBot\MyChannel\Message.txt
}
}
on *:TEXT:!stopmessage:#bloodbath102: {
if ($nick isop #) {
msg $chan Message cycle is now stopping.
.timerLinks off
}
}
on *:TEXT:!startlink:#bloodbath102: {
if ($nick isop #) {
msg $chan Link cycle is now starting.
.timerLinks 0 600 .play # E:\Twitch\BeckonedBot\MyChannel\Links.txt
}
}
on *:TEXT:!stoplink:#bloodbath102: {
if ($nick isop #) {
msg $chan Link cycle is now stopping.
.timerLinks off
}
}
on *:TEXT:!startbeckoned:#bloodbath102: {
if ($nick isop #) {
msg $chan Message cycle is now starting.
.timerLinks 0 300 .play # E:\Twitch\BeckonedBot\BeckonedGamers.txt
}
}
on *:TEXT:!stopbeckoned:#bloodbath102: {
if ($nick isop #) {
msg $chan Message cycle is now stopping.
.timerLinks off
}
}
;------------------------
;Custom Commands
;------------------------
on *:TEXT:!mcip:#:{
msg # The Minecraft server IP is: play.beckonedgamers.com
}
on *:TEXT:!tsip:#: {
msg # The team speak IP is: play.beckonedgamers.com
}
;------------------------
;Points
;------------------------
alias -l addPoints {
if ($1 !isnum) { echo 2 -st $1 is not a number. It needs to be a number. | halt }
var %topic $+($chan,.,$nick)
var %points $calc($readini(Points.ini,%topic,Points) + $1)
writeini -n Points.ini %topic Points %points
return %points
}
alias -l lookUpPoints {
var %topic $+($chan,.,$nick)
var %points $readini(Points.ini,%topic,Points)
return %points
}
alias doaddpoints {
if ($3 !isnum) { echo 2 -st $3 is not a number. It needs to be a number. | halt }
var %topic $+($1,.,$2)
var %points $calc($readini(Points.ini,%topic,Points) + $3)
writeini -n Points.ini %topic Points %points
echo -a Added points for %topic
}
alias dorempoints {
var %topic $+($1,.,$2)
remini -n Points.ini %topic Points
echo -a Removed points for %topic
}
on $*:text:!points (add|remove|del)/Si:#:{
if ($nick isop #) {
if ($0 < 3) { msg # Insufficient parameters: Use !points <add|remove|del> <user> [number] | return }
writeini -n Points.ini $+(#,.,$3) Points $calc($readini(Points.ini,$+(#,.,$3),Points) $iif($2 == add,+,-) $iif($4 isnum,$4,1))
msg $chan $3 now has $readini(Points.ini,$+(#,.,$3),Points) total points.
}
else { msg $chan This command is only available to moderators. }
}
ON !*:JOIN:#: {
$+(.timerpoints.,#,.,$nick) 0 120 add.pts $+(#,.,$nick)
add.pts $+(#,.,$nick)
if ((%floodjoin) || ($($+(%,floodjoin.,$nick),2))) { return }
set -eu10 %floodjoin On
set -eu30 %floodjoin. $+ $nick On
msg $chan $nick has joined the channel and is now earning points.
}
ON *:KICK:#: {
if ($knick !== $me) {
$+(.timerpoints.,#,.,$knick) off
if ((%floodkick) || ($($+(%,floodkick.,$knick),2))) { return }
set -eu10 %floodkick On
set -eu30 %floodkick. $+ $nick On
msg $chan $knick has left the channel and is no longer earning points.
}
}
ON !*:QUIT: {
$+(.timerpoints.,#,.,$nick) off
if ((%floodquit) || ($($+(%,floodquit.,$nick),2))) { return }
set -eu10 %floodquit On
set -eu30 %floodquit. $+ $nick On
msg $chan $nick has left the channel and is no longer earning points.
}
ON !*:PART:#: {
$+(.timerpoints.,#,.,$nick) off
if ((%floodpart) || ($($+(%,floodpart.,$nick),2))) { return }
set -eu10 %floodpart On
set -eu30 %floodpart. $+ $nick On
msg $chan $nick has left the channel and is no longer earning points.
}
alias add.pts { if ($1) { writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points) + 1) } }
;------------------------
;Poll
;------------------------
on *:TEXT:!poll *:#: {
if (($nick !isop $chan) && ($$2 != results)) {
msg $chan Only mods may use this feature.
}
else {
; *********
; OPEN POLL
; *********
if ($$2 == open) {
unset $($+(%,polloptions,$chan),1)
unset $($+(%,pollvotes,$chan),1)
unset $($+(%,hasvoted,$chan),1)
set $($+(%,polloptions,$chan),1) $3-
var %numberofoptions $numtok($3-,124)
while ( %numberofoptions > 0 ) {
dec %numberofoptions
set $($+(%,pollvotes,$chan),1) $($+(%,pollvotes,$chan),2) 0
}
var %number $numtok($($+(%,polloptions,$chan),2),124)
while (%number > 0) {
if (%number == $numtok($($+(%,polloptions,$chan),2),124)) {
var %finalresults %number - $gettok($($+(%,polloptions,$chan),2),%number,124) %finalresults
}
else {
var %finalresults %number - $gettok($($+(%,polloptions,$chan),2),%number,124) || %finalresults
}
dec %number
}
msg $chan A new poll has been opened: %finalresults
}
; ************
; POLL RESULTS
; ************
elseif ($$2 == results) {
if ($($+(%,polloptions,$chan),2) != $null) {
msg $chan Current Results are: $pollresults
}
else {
msg $chan Results for previous poll are: $($+(%,oldresults,$chan),2)
}
}
; **********
; POLL CLOSE
; **********
elseif ($$2 == close) {
msg $chan $nick has closed the poll! Results are: $pollresults
set $($+(%,oldresults,$chan),1) $pollresults
unset $($+(%,polloptions,$chan),1)
unset $($+(%,pollvotes,$chan),1)
unset $($+(%,hasvoted,$chan),1)
}
}
}
alias pollresults {
var %number $numtok($($+(%,polloptions,$chan),2),124)
while (%number > 0) {
if (%number == $numtok($($+(%,polloptions,$chan),2),124)) {
var %finalresults $gettok($($+(%,polloptions,$chan),2),%number,124) : $gettok($($+(%,pollvotes,$chan),2),%number,32) votes %finalresults
}
else {
var %finalresults $gettok($($+(%,polloptions,$chan),2),%number,124) $+ : $gettok($($+(%,pollvotes,$chan),2),%number,32) votes || %finalresults
}
dec %number
}
return %finalresults
}
on *:TEXT:!vote *:#: {
if ( $($+(%,polloptions,$chan),2) == $null) {
msg $chan There is no open poll to vote on!
}
elseif ($nick isin $($+(%,hasvoted,$chan),2)) {
msg $chan $nick $+ , you have already voted in this poll!
}
elseif ($$2 !isnum 1 - $numtok($($+(%,pollvotes,$chan),2),32)) {
msg $chan $$2- is not a valid poll option!
}
else {
set $($+(%,hasvoted,$chan),1) $($+(%,hasvoted,$chan),2) $nick
var %voteupdate $gettok($($+(%,pollvotes,$chan),2),$$2,32)
inc %voteupdate
set $($+(%,pollvotes,$chan),1) $puttok($($+(%,pollvotes,$chan),2),%voteupdate,$$2,32)
msg $chan $nick has voted for option $$2 $+ : $gettok($($+(%,polloptions,$chan),2),$$2,124)
}
}
;------------------------
;Raffle
;------------------------
on *:text:!raffle on:#: {
if ($nick isop #) {
.enable !ticket | /msg $chan A raffle/giveaway is now in progress. To enter the giveaway, type "!ticket"; only 1 ticket is allowed per user. Each ticket costs 50 points. Good luck!
}
else { msg $chan This command is only available to moderators. }
}
on *:text:!raffle off:#: {
if ($nick isop #) {
.disable !ticket | /msg $chan Raffle/giveaway system is now OFF. }
else { msg $chan This command is only available to moderators. }
}
on *:text:!ticket:#:{
if ($hget($+(tickets.,#),$nick)) { msg # $nick , you already have a ticket! | return }
var %topic = $+(#,.,$nick)
; Check if enough points
if ($readini(Points.ini,%topic,Points) >= 50) {
; Deduct the points
var %a = $v1 - 50
writeini Points.ini %topic Points %a
; Add the user to tickets.#channel hash table, creating the table if it doesn't exist
hadd -m $+(tickets.,#) $nick 1
msg # $nick spent 50 points on a raffle ticket.
}
else msg # Sorry $nick , you don't have enough points to join this raffle. }
on *:text:!roll:#:{
if ($nick isop #) {
if ($hget($+(tickets.,#))) {
var %i = $r(1,$hget($+(tickets.,#),0).item)
msg # The winner is $hget($+(tickets.,#),%i).item
; The next line frees the table (all data in it is gone)
hfree $+(tickets.,#)
}
else msg # There are no ticket entries at this time.
}
else msg # $nick, only moderators can use that command.
}
;------------------------
;Link Protection
;------------------------
on *:text:!links*:#: {
if ($nick isop #) {
if ($2 == on) {
if (%links) {
msg # Link protection is already enabled
return
}
else {
msg # Link protection enabled
set %links On
return
}
}
if ($2 == off) {
if (%links) {
msg # Link protection disabled
unset %links on
return
}
else {
msg # Link protection is already disabled
return
}
}
else { msg # ' $+ $2 $+ ' is not a valid function. use '!links on' to enable link protection and '!links off' to disable it again. }
}
}
on *:text:!permit*:#: {
if ($nick isop #) {
if (%links) {
set -u30 %permit $addtok(%permit,$2,32)
msg $chan You have 30 seconds to post a link, $2
}
}
}
on +201:text:*:#: {
if ($nick isop #) { return }
if ($istok(%permit,$nick,32)) { return }
if (%links) {
if (*www.* iswm $1- || *http://* iswm $1- || *.com* iswm $1- || *.tv* iswm $1- || *.nl* iswm $1- || *.sh* iswm $1- || *.net* iswm $1- || *.me* iswm $1-) {
.ruser 201 $nick
msg # /timeout $nick 86400
msg # That was your 3rd link. Try again tomorrow, $nick [Link] [24h]
return
}
}
}
on +200:text:*:#: {
if ($nick isop #) { return }
if ($istok(%permit,$nick,32)) { return }
if (%links) {
if (*www.* iswm $1- || *http://* iswm $1- || *.com* iswm $1- || *.tv* iswm $1- || *.nl* iswm $1- || *.sh* iswm $1- || *.net* iswm $1- || *.me* iswm $1-) {
.ruser 200 $nick | .auser 201 $nick | .timermsg 1 3600 .ruser 201 $nick
msg # /timeout $nick
msg # No links without permission, $nick $+ ! [Link] [Timeout]
return
}
}
}
on *:text:*:#: {
if ($nick isop #) { return }
if ($nick == PUT CASTER HERE) { return }
if ($istok(%permit,$nick,32)) { return }
if (%links) {
if (*www.* iswm $1- || *http://* iswm $1- || *.com* iswm $1- || *.tv* iswm $1- || *.nl* iswm $1- || *.sh* iswm $1- || *.net* iswm $1- || *.me* iswm $1-) {
msg $chan /timeout $nick 10
msg $chan Please ask permission before posting a link, $nick [Link] [Warning]
.auser 200 $nick | .timermsg 1 3600 .ruser 200 $nick
return
}
}
}
;------------------------
;Clearchat
;------------------------
;------------------------
;Help
;------------------------
on *:TEXT:!help:#:{
msg # Commands can be found here:
http://goo.gl/jFj4oZ.}
;------------------------
;Test
;------------------------
on *:TEXT:!test:#: {
if ((%flood!test) || ($($+(%,flood!test.,$nick),2))) { return }
set -u10 %flood!test On
set -u30 %flood!test. $+ $nick On
msg $chan /me Im Here $+
}
;-------------------------
;
;-------------------------
;-------------------------
;
;-------------------------
;-------------------------
;
;-------------------------
;-------------------------
;Test Script
;-------------------------