|
dogtag
|
dogtag
|
hi guys..im really new to this scripting.. i have several issues the first one when i type "!scrim off" it says it has been stopped but it actually doesnt stop and it keep on going..the other issue that the "!players" list doesnt get reset after I "!scrim off" the same list of players stays there until someone type "!leave" is there a certain command to make it reset manually for example "!Reset".. Thanks in advance and for you time reading my problem. dogtag.
on *:join:#: notice $nick Hi $nick We are glad that you joined us! Ask an active admin to start Scrim Organizer now! type !Help for more information TESTING
on *:text:!help:#:{
msg $nick The help contents for IRC Scrim Commands
msg $nick !Scrim on/off - Use this command in an active Scrim channel to start/stop a game. ONLY OPERATORS CAN START SCRIM ORGANIZER.
.msg $nick !Join - Use this command to get in a list for the next available match.
.msg $nick !Leave - Someone just go bored? use this command to leave.
msg $nick !Players - To get a list of players that are ready to play.
on *:text:!scrim on:#:{
if %scrim.channel { .msg $chan $nick Yes sir, Scrim is already active check out for registered players for available slots "!players" }
else {
if !$nick($chan,$nick,a,hrv) { msg $chan Sorry $nick $+ , but only ops can start it. }
else {
set %scrim.channel $chan
describe $chan sees that $nick has started the Game. 4,99 Type !join in order to play.
timer 1 178 describe $chan Scrim has now started, Go go go!
timer 1 179 describe $chan 5 Players are ready join a server!
timer 1 180 scrim_game
}
}
}
alias -l scrim_game {
.enable #testgamers
var %a = 1, %b = $nick(%scrim.channel,0)
while %a <= %b {
if $istok(%sluts,$nick(%scrim.channel,%a),44) {
set %scrim.asker %a
msg %scrim.channel $nick(%scrim.channel,%a) Ready?
msg %slut.channel Lock,n,Load !
%a = %b
}
inc %a
}
}
on *:text:!scrim off:%scrim.channel:{
if !$nick($chan,$nick,a,hrv) { msg $nick Sorry, but only ops can stop it. }
else {
describe $chan $nick has stopped Scrim.
unset %scrim.channel
.disable #testgamers
}
}
on *:text:!players:%scrim.channel:{
.msg $chan $nick Current players are %scrims
}
on *:text:!join:#:{
if !%scrim.channel {
msg $chan Scrim isn't active. Ask an Op to start it.
}
elseif $chan == %scrim.channel && $group(#testgamers) == off {
set %scrims $addtok(%scrims,$nick,44)
set $+(%,scrim.points,.,$nick) 5
.msg $chan Thank you $nick for signing up. LOCK'N'LOAD!
}
elseif $group(#testgamers) == on {
.msg $nick Sorry, no more players until next game
}
}
#testgamers on
#testgamers end
on *:exit:{
unset %scrim*
}
on *:disconnect:{
unset %scrim*
|
|
|
|
Joined: Aug 2004
Posts: 7,168
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,168 |
1) You're missing two } one at the end of the !help section and one at the very end of the code.
2) You don't have anything in the !scrim off section to reset the variable that contains the players. Just add an unset command for that variable.
3) A !reset command could be added. Would it just reset the players list leaving the game on, or would it turn the game off as well (same thing a !scrim off)?
|
|
|
|
5618
|
5618
|
I fixed some stuff, I think. Hopefully this works. I don't see why you're using /enable group though, since you're not using the internal user list. And I assume %sluts is some variable with nicks in it separated by commas? Doesn't appear anywhere else in the script. on *:JOIN:#:{ notice $nick Hi $nick We are glad that you joined us! Ask an active admin to start Scrim Organizer now! type !Help for more information TESTING }
on *:TEXT:!help:#:{
msg $nick The help contents for IRC Scrim Commands
msg $nick !Scrim on/off - Use this command in an active Scrim channel to start/stop a game. ONLY OPERATORS CAN START SCRIM ORGANIZER.
msg $nick !Join - Use this command to get in a list for the next available match.
msg $nick !Leave - Someone just go bored? use this command to leave.
msg $nick !Players - To get a list of players that are ready to play.
}
on *:TEXT:!scrim on:#:{
if (%scrim.channel) { msg $chan $nick Yes sir, Scrim is already active check out for registered players for available slots "!players" }
elseif ($nick !isop $chan) { msg $chan Sorry $nick $+ , but only ops can start it. }
else {
set %scrim.channel $chan
describe $chan sees that $nick has started the Game. 4,99 Type !join in order to play.
timer 1 178 describe $chan Scrim has now started, Go go go!
timer 1 179 describe $chan 5 Players are ready join a server!
timer 1 180 scrim_game
}
}
alias -l scrim_game {
enable #testgamers
var %a = 1, %b = $nick(%scrim.channel,0)
while (%a <= %b) {
if ($istok(%sluts,$nick(%scrim.channel,%a),44) == $true) {
set %scrim.asker %a
msg %scrim.channel $nick(%scrim.channel,%a) Ready?
msg %slut.channel Lock,n,Load !
break
}
inc %a
}
}
on *:TEXT:!scrim off:%scrim.channel:{
if ($nick !isop $chan) { msg $nick Sorry, but only ops can stop it. }
else {
describe $chan $nick has stopped Scrim.
unset %scrim.channel
disable #testgamers
}
}
on *:TEXT:!players:%scrim.channel:{ .msg $chan $nick Current players are %scrims }
on *:TEXT:!join:#:{
if (!%scrim.channel) { msg $chan Scrim isn't active. Ask an Op to start it. }
elseif ($chan == %scrim.channel && $group(#testgamers) == off) {
set %scrims $addtok(%scrims,$nick,44)
set $+(%,scrim.points,.,$nick) 5
msg $chan Thank you $nick for signing up. LOCK'N'LOAD!
}
elseif ($group(#testgamers) == on) { .msg $nick Sorry, no more players until next game }
}
#testgamers on
#testgamers end
on *:EXIT:{ unset %scrim* }
on *:DISCONNECT:{ unset %scrim* }
Last edited by 5618; 23/06/07 09:59 AM.
|
|
|
|
dogtag
|
dogtag
|
Hey man thanks for you instant help!!  1) Added those two curly brackets. 2) Could you verify me the exact unset command for the variable im looking for? sorry im not that smart at it  "on *:text:!scrim off: { unset %scrim* } " 3) Yes !reset just to reset the players list leaving the game on. Many thanks! 
Last edited by dogtag; 23/06/07 09:55 AM.
|
|
|
|
dogtag
|
dogtag
|
Thanks alot man!  I really appreciate it! as I said im totally noob at this heh :/, the %sluts you were right at it  it should be %scrims, is there anyway to put numbers instead of commas from 1 to 10? and how can I limit the game to 10 players only? cheers 
|
|
|
|
Joined: Aug 2004
Posts: 7,168
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,168 |
Hmm... As a noob, I really have to wonder where you got the original code from, especially in consideration of the similarities between your code (and the mistake between %sluts and %scrims) and my code which I was having difficulties with and posted here I don't mind if you used my code, but if you did, it would be nice for you to acknowledge the fact. In regards to putting numbers rather than commas, while it's possible, it's not simple and can cause confusion later on if you or someone else has trouble with the code and needs help. As to limiting the game to 10 players, since you track the players in a variable, and the names are separated by commas (at the moment), all you need to do is check to see how many names are in the variable. Check the help file under Token Identifiers.
|
|
|
|
|