League script
Posted by varunpp
Monday, April 12, 2004
Description: Cant get -clan * to work properly
]
;edit %chan for channel, %cmd for command prefix, and %color for color
on *:START: {
set %cmd -
set %chan #teamwoc
set %color [^K]1,0
}
;This is the Socks for posting in the forums
alias forums {
sockclose forums
sockopen forums www.warriorsoc.com 80
sockmark forums $1-
}
on *:sockopen:forums: {
var %post = username=WoC_BoT&subject= $+ $replace($sock($sockname).mark,$chr(32),+) $+ &addbbcode18=%23e5e5e5&addbbcode20=12&helpbox=Tip%3A+Styles+can+be+applied+quickly+to+selected+text.&message= $+ %postm $+ &mode=reply&t=53&post=Submit
sockwrite -n $sockname POST /forums/posting.php HTTP/1.1
sockwrite -n $sockname Host: www.warriorsoc.com
sockwrite -n $sockname Connection: close
sockwrite -n $sockname Content-Type: application/x-www-form-urlencoded
sockwrite -n $sockname Content-Length: $len(%post)
sockwrite -n $sockname
sockwrite -n $sockname %post
}
on *:sockread:forums: {
var %temp
sockread %temp
if (%temp) echo 5 -s %temp
}
on 995:TEXT:$(%cmd $+ addclan *):%chan: {
if ($ini(clans.ini,$remove($gettok($1-,1,44),-addclan $+ $chr(32)))) {
notice $nick %color $+ $remove($gettok($1-,1,44),-addclan $+ $chr(32)) is already on the list
halt
}
elseif ($numtok($gettok($1-,2,44),32) == 6) {
var %clan = $gettok($2-,1,44)
%postm = Clan: %clan $eval(%0D,0)
var %i = 1, %tokens = Channel: Website: Email: Leader: Location: Private-Server:
while ($gettok(%tokens,%i,32)) {
writeini clans.ini $+(",%clan,") $ifmatch $gettok($gettok($1-,2,44),%i,32)
%postm = %postm $+ $crlf $ifmatch $gettok($gettok($1-,2,44),%i,32)
inc %i
}
forums
notice $nick %color $+ Clan $+(",%clan,") added
}
else {
notice $nick %color $+ Not enough parameters
}
}
alias information {
if ($1 == 1) {
return Channel: $readini(clans.ini,$2,Channel)
}
elseif ($1 == 2) {
return Website: $readini(clans.ini,$2,Website)
}
elseif ($1 == 3) {
return Email: $readini(clans.ini,$2,Email)
}
elseif ($1 == 4) {
return Leader: $readini(clans.ini,$2,Leader)
}
elseif ($1 == 5) {
return Location: $readini(clans.ini,$2,Location)
}
elseif ($1 == 6) {
return Private-Server $+ : $readini(clans.ini,$2,Server(private) $+ )
}
}
on *:TEXT:$(%cmd $+ clan *):%chan:{
if ($ini(clans.ini,$remove($gettok($1-,1,44),-clan $+ $chr(32)))) {
var %i 1
while (%i <= 6) {
notice $nick %color $+ $information(%i,$remove($gettok($1-,1,44),-clan $+ $chr(32)))
inc %i
}
}
else {
notice $nick %color $+ No such clan $2-
}
}
on 995:TEXT:$(%cmd $+ delclan *):%chan: {
if ($ini(clans.ini,$2-)) {
remini clans.ini $+(",$2-,")
notice $nick %color $+ Profile " $+ $2- $+ " deleted
}
else {
notice $nick %color $+ Profile $2- not found
}
}
on *:TEXT:$(%cmd $+ clans*):%chan: {
notice $nick %color $+ There are currently [^B] $+ $ini(clans.ini,0) $+ [^B] clan $+ $iif($ini(clans.ini,0) == 1,.,s.)
var %i 1
while (%i <= $ini(clans.ini,0)) {
set %tempclans $iif(%tempclans,%tempclans $+ $chr(44) $+ $ini(clans.ini,%i),$ini(clans.ini,%i))
inc %i
}
notice $nick %color $+ $iif($ini(clans.ini,0) == 1,That clan is,Those clans are) : %tempclans
unset %tempclans
}