|
dailyproblem
|
dailyproblem
|
Ok so here is my code,
on *:text:!addcom *:#: {
if ($nick isop #) {
var %r = $read(commands.txt,ns,$2)
if (%r) { .msg $chan [ $+ $nick $+ ]: Error, This command $qt($2) is already exist into the database! | return }
write commands.txt $2-
msg $chan /me + Command $2 has been added to the database!
}
}
on *:text:!delcom *:#: {
if ($nick isop #) {
var %r = $read(commands.txt,ns,$2)
if (!%r) { .msg $chan [ $+ $nick $+ ]: Error, This command $qt($2) does NOT exist into the database! | return }
write -dl $+ $readn commands.txt
msg $chan /me - Command $2- has been deleted from the database!
}
}
on *:text:!editcom & *:#: {
if ($nick isop #) {
var %r = $read(commands.txt,ns,$2)
if (!%r) { .msg $chan [ $+ $nick $+ ]: Error, This command $qt($2) does NOT exist into the database! | return }
write -l $+ $readn commands.txt $2-
msg $chan /me -> Command $2 has been updated!
}
}
ON *:TEXT:*:#: { tokenize 32 $strip($1-,burci)
if ($read(commands.txt, nts, $1)) {
var %com = $v1
var %com = $replace(%com,@user@,$iif($2,$2,?),@nick@,$nick,@target@,$target)
if (-ul=mod == $gettok(%com,1,32)) && ($nick !isop $chan) { msg $chan | return }
msg $chan $iif(-ul=mod == $gettok(%com,1,32),$gettok(%com,2-,32),$gettok(%com,1-,32))
}
}
on *:text:!so &:#: {
if ($nick isop #) {
msg # $2 is awesome go view them at twitch.tv/ $+ $2
}
}
on *:text:!raid &:#: {
if ($nick isop #) {
msg # We are raiding $2 twitch.tv/ $+ $2
msg # We are raiding $2 twitch.tv/ $+ $2
msg # We are raiding $2 twitch.tv/ $+ $2
msg # We are raiding $2 twitch.tv/ $+ $2
msg # We are raiding $2 twitch.tv/ $+ $2
msg # We are raiding $2 twitch.tv/ $+ $2
msg # We are raiding $2 twitch.tv/ $+ $2
msg # We are raiding $2 twitch.tv/ $+ $2
msg # We are raiding $2 twitch.tv/ $+ $2
msg # We are raiding $2 twitch.tv/ $+ $2
}
}
on *:TEXT:!ban &:#: {
if ($nick isop #) {
msg # $2 has been banned for 12 hours, you will be reviewed by a high ranking mod. If this is fair, you will be banned. If not, see ya tomorrow!
msg # /timeout $2 43200
}
}
on *:TEXT:!b &:#: {
if ($nick isop #) {
msg # /timeout $2 43200
}
}
on *:text:!mods:#: {
if (!%twitchmodlst.delay) {
var %t = 1
while (%t <= $nick(#,0,o)) {
var %tmod = $iif(%tmod,%tmod $nick(#,%t,o),$nick(#,%t,o))
inc %t
}
set -eu60 %twitchmodlst.delay 1
msg # Mods Online: $iif(%tmod,%tmod,None)
}
}
on *:TEXT:!rc:#: {
if ($nick isop #) {
msg # raffle {start|end}, winner, ticket #(50 or less, cost 50 each), entries
}
}
on *:text:!cost:#: {
if ($nick isop #) {
msg # The cost of the raffle is 50 points per ticket, you want more tickets so you win!!!!!
}
}
======POINTS======
on *:TEXT:!top10:#:{
{ top10 # }
}
alias -l top10 {
window -h @. | var %i 1
while $gettok($remove($read(points.ini,w,$+(*,$1,*),%i),[,]),2,46) {
var %n $v1, %p $gettok($read(points.ini,$calc($readn + 1)),2,61)
aline @. %n %p
var %i $calc($readn + 1)
}
filter -cetuww 2 32 @. @.
var %i 1 | while %i <= 10 {
var %list $addtok(%list,$line(@.,%i),44)
inc %i
}
msg $1 Top 10 point are: $replace(%list,$chr(44),$+($chr(44),$chr(32)))
window -c @.
}
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:!bal:#:{
if ((%floodpoints) || ($($+(%,floodpoints.,$nick),2))) { return }
set -u10 %floodpoints On
set -u30 %floodpoints. $+ $nick On
msg # $nick has $readini(Points.ini,$+(#,.,$nick),Points) total points.
}
on $*:text:/!bal (add|remove)/Si:#:{
if ($nick isop #) {
if ($0 < 3) { msg # Insufficient parameters: Use !points <add|remove> <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 60 add.pts $+(#,.,$nick)
add.pts $+(#,.,$nick)
}
on !*:part:#:$+(.timerpoints.,#,.,$nick) off
alias -l add.pts {
writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points) + 1)
}
========RAFFLE========
on *:TEXT:!ticket &:#:{
if (%open == 1) {
if ($2 > 50) {
msg $chan $nick $+ , you cannot buy that many tickets!
}
if ($2 < 51) {
var %i = 0
var %count = $2
var %topic = $+(#,.,$nick)
var %user = $readini(Points.ini,%topic,Points)
var %final = 50 * %count
var %remove = %user - %final
if (%remove > 0) {
writeini -n Points.ini %topic Points %remove
while (%i < %count) {
write Raffle.txt $nick
%i = %i + 1
}
msg $chan $nick $+ , has bought %count tickets spending %final points!
}
if (%remove < 0) {
msg $chan Sorry $nick but you don't have enough points to buy %count tickets!
}
}
}
}
on *:TEXT:*:#:{
if ($nick == dailyproblem) {
if ($1 == !raffle) {
if ($2 == start) {
msg $chan /me [RAFFLE STARTED]
set %open 1
write -c Raffle.txt
echo -a Raffle Started
}
if ($2 == end) {
msg $chan /me [RAFFLE CLOSED]
set %open 0
write -c Raffle.txt
echo -a Raffle Closed
}
}
if ($1 == !winner) {
if (%open == 1) {
var %user = $read(Raffle.txt,n)
write -c Raffle.txt
set %open 0
msg $chan /me And the winner is... %user $+ !!! Well Done!
echo -a Raffle Closed
}
}
}
if ($1 == !Entries) {
if (%open == 1) {
msg $chan There are currently $lines(Raffle.txt) tickets entered into the raffle!
}
}
}
And right after the tokenize spot, it stops working, Ive changed the order of stuff and only the first parts work, what am i doing wrong?
|
|
|
|
Joined: Jan 2004
Posts: 1,330
Hoopy frood
|
Hoopy frood
Joined: Jan 2004
Posts: 1,330 |
Only a single text event is ever triggered per file. ON *:TEXT:*:#:{
tokenize 32 $strip($1-,burci) This captures all text and stops any text events below it from running. You will need to combine this with the other catch-all text event (below your other events) or move them to different files. Also, don't put commands on the same line as an opening brace unless you're going to close the brace on the same line. And don't use braces where they aren't needed, like here:
|
|
|
|
Belhifet
|
Belhifet
|
Ninjad
Last edited by Belhifet; 13/05/15 08:10 PM.
|
|
|
|
Joined: Jan 2004
Posts: 1,330
Hoopy frood
|
Hoopy frood
Joined: Jan 2004
Posts: 1,330 |
If you're going to edit out your post you can just delete it.
|
|
|
|
dailyproblem
|
dailyproblem
|
I put it at the bottom and did everything else you have said, the entire !addcom,editcom,delcom script does not work at all now.
on *:text:!addcom *:#: {
if ($nick isop #) {
var %r = $read(commands.txt,ns,$2)
if (%r) { .msg $chan [ $+ $nick $+ ]: Error, This command $qt($2) is already exist into the database! | return }
write commands.txt $2-
msg $chan /me + Command $2 has been added to the database!
}
}
on *:text:!delcom *:#: {
if ($nick isop #) {
var %r = $read(commands.txt,ns,$2)
if (!%r) { .msg $chan [ $+ $nick $+ ]: Error, This command $qt($2) does NOT exist into the database! | return }
write -dl $+ $readn commands.txt
msg $chan /me - Command $2- has been deleted from the database!
}
}
on *:text:!editcom & *:#: {
if ($nick isop #) {
var %r = $read(commands.txt,ns,$2)
if (!%r) { .msg $chan [ $+ $nick $+ ]: Error, This command $qt($2) does NOT exist into the database! | return }
write -l $+ $readn commands.txt $2-
msg $chan /me -> Command $2 has been updated!
}
}
ON *:TEXT:*:#: {
tokenize 32 $strip($1-,burci)
if ($read(commands.txt, nts, $1)) {
var %com = $v1
var %com = $replace(%com,@user@,$iif($2,$2,?),@nick@,$nick,@target@,$target)
if (-ul=mod == $gettok(%com,1,32)) && ($nick !isop $chan) { msg $chan | return }
msg $chan $iif(-ul=mod == $gettok(%com,1,32),$gettok(%com,2-,32),$gettok(%com,1-,32))
}
}
Correction, The main problem I am having is it will not repeat the command back to me, I have it now as all the !addcom !editcom !delcom script is at the top, and the tokenize is at the bottom, it will let me edit add and delete, but it will not repeat it back to me. What did I do wrong?
ON *:TEXT:*:#: { tokenize 32 $strip($1-,burci)
if ($read(commands.txt, nts, $1)) {
var %com = $v1
var %com = $replace(%com,@user@,$iif($2,$2,?),@nick@,$nick,@target@,$target)
if (-ul=mod == $gettok(%com,1,32)) && ($nick !isop $chan) { msg $chan | return }
msg $chan $iif(-ul=mod == $gettok(%com,1,32),$gettok(%com,2-,32),$gettok(%com,1-,32))
}
}
Last edited by dailyproblem; 13/05/15 09:33 PM.
|
|
|
|
dailyproblem
|
dailyproblem
|
It used to work, but in the last few days it stopped.
|
|
|
|
Joined: Jan 2014
Posts: 107
Vogon poet
|
Vogon poet
Joined: Jan 2014
Posts: 107 |
anyone know why the addcom, delcom, editcom stuff stopped working?
and if there is a workaround for it?
|
|
|
|
Joined: May 2015
Posts: 245
Fjord artisan
|
Fjord artisan
Joined: May 2015
Posts: 245 |
Do you use this new /membership stuff?
|
|
|
|
|