|
Joined: Aug 2006
Posts: 44
Ameglian cow
|
OP
Ameglian cow
Joined: Aug 2006
Posts: 44 |
Everything in this works but the !add. I was wondering if any of you would be able to fix this for me. Thank you. on me:*:join:#:{
if $hget(Blacklist,$+($network,.,$chan)) == $null {
.hadd -m Blacklist $+($network,.,$chan) 3
.hadd -m Blacklist $network $addtok($hget(Blacklist,$network),$chan,44)
}
elseif $hget(Blacklist,$+($network,.,$chan)) < 1 {
.msg $chan 4This channel has been blacklisted. If you wish to get off the black list message 6Xtibian4.
.part $chan
}
else {
.msg $chan 6There are4 $hget(Blacklist,$+($network,.,$chan)) kicks 6of me left before this channel is 4blacklisted6.
}
}
on *:kick:#:{
if $knick == $me {
.hdec -m Blacklist $+($network,.,$chan) 1
if $hget(Blacklist,$+($network,.,$chan)) {
.join $chan
}
}
}
on *:start:{
if !$hget(Blacklist) { .hmake Blacklist 10 }
if $exists(Blacklist.hsh) { .hload Blacklist Blacklist.hsh }
}
on *:exit:{
.hsave -o Blacklist Blacklist.hsh
}
on *:disconnect:{
.hsave -o Blacklist Blacklist.hsh
}
on *:connect:{
if $hget(Blacklist,$network) {
.join $hget(Blacklist,$network)
}
}
on *:text:!remove*:*:{
if ($nick == Xtibian) {
if !$2 {
.notice $nick 6No network or channel specified.
}
elseif !$3 {
if $hfind(Blacklist,$+($2,.,*),0,w) {
.hdel +w Blacklist $+($2,.,*)
.notice $nick 6Network4 $2 6removed from 4blacklist6.
}
elseif $hfind(Blacklist,$+(*,.,$2),0,w) {
.hdel +w Blacklist $+(*,.,$2)
.notice $nick 6Channel4 $2 6removed from all networks on 4blacklist6.
}
else {
.notice $nick $2 not found in blacklist.
}
}
elseif $hfind(Blacklist,$+($2,.,$3),0) {
.hdel Blacklist $+($2,.,$3)
.notice $nick Channel $3 on network $2 removed from blacklist.
}
else {
.hsave -o Blacklist Blacklist.hsh | .hload Blacklist Blacklist.hsh
.notice $nick Channel $3 on network $2 not found on blacklist.
}
}
else {
.notice $nick Channel $3 on network $2 not found on blacklist.
}
}
on *:text:!add*:*:{
if ($nick == Xtibian) {
if !$2 {
.notice $nick 6No network or channel specified.
}
elseif !$3 {
.hadd -m Blacklist $+($network,.,$2)
.hadd -m Blacklist $network $addtok($hget(Blacklist,$network),$2,44)
.notice $nick Channel $2 added for Network $network
}
else {
.hadd -m Blacklist $+($2,.,$3)
.hadd -m Blacklist $2 $addtok($hget(Blacklist,$2),$3,44)
.notice $nick Channel $2 added for Network $3
}
}
.hsave -o Blacklist Blacklist.hsh | .hload Blacklist Blacklist.hsh
}
Newbie Scripter. Learning pretty fast...lol :P
|
|
|
|
Joined: Dec 2005
Posts: 58
Babel fish
|
Babel fish
Joined: Dec 2005
Posts: 58 |
Use One Text Event Like this ;
on *:text:*:*:{
if ($1 == !remove) {
if ($nick == Xtibian) {
if !$2 {
.notice $nick 6No network or channel specified.
}
elseif !$3 {
if $hfind(Blacklist,$+($2,.,*),0,w) {
.hdel +w Blacklist $+($2,.,*)
.notice $nick 6Network4 $2 6removed from 4blacklist6.
}
elseif $hfind(Blacklist,$+(*,.,$2),0,w) {
.hdel +w Blacklist $+(*,.,$2)
.notice $nick 6Channel4 $2 6removed from all networks on 4blacklist6.
}
else {
.notice $nick $2 not found in blacklist.
}
}
elseif $hfind(Blacklist,$+($2,.,$3),0) {
.hdel Blacklist $+($2,.,$3)
.notice $nick Channel $3 on network $2 removed from blacklist.
}
else {
.hsave -o Blacklist Blacklist.hsh | .hload Blacklist Blacklist.hsh
.notice $nick Channel $3 on network $2 not found on blacklist.
}
}
else {
.notice $nick Channel $3 on network $2 not found on blacklist.
}
}
if ($1 == !add) {
if ($nick == Xtibian) {
if !$2 {
.notice $nick 6No network or channel specified.
}
elseif !$3 {
.hadd -m Blacklist $+($network,.,$2)
.hadd -m Blacklist $network $addtok($hget(Blacklist,$network),$2,44)
.notice $nick Channel $2 added for Network $network
}
else {
.hadd -m Blacklist $+($2,.,$3)
.hadd -m Blacklist $2 $addtok($hget(Blacklist,$2),$3,44)
.notice $nick Channel $2 added for Network $3
}
}
.hsave -o Blacklist Blacklist.hsh | .hload Blacklist Blacklist.hsh
}
}
tags there -> if ($1 == !remove) & if ($1 == !add)
i like that
|
|
|
|
Joined: Aug 2006
Posts: 44
Ameglian cow
|
OP
Ameglian cow
Joined: Aug 2006
Posts: 44 |
Thank you, but the !add still doesn't work right. :S
Newbie Scripter. Learning pretty fast...lol :P
|
|
|
|
Joined: Jul 2006
Posts: 26
Ameglian cow
|
Ameglian cow
Joined: Jul 2006
Posts: 26 |
Don't you just hate it when a command doesn't work properly? :P
Btw, Xtibian, I sent you a PM.
Very new to mIRC, don't know much.
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
For a single on text event, he'd be better using on *:text:*:*:{
if ($nick == Xtibian) {
if !$2 {
.notice $nick 6No network or channel specified.
}
elseif ($1 == !remove) {
if !$3 {
if $hfind(Blacklist,$+($2,.,*),0,w) {
.hdel +w Blacklist $+($2,.,*)
.notice $nick 6Network4 $2 6removed from 4blacklist6.
}
elseif $hfind(Blacklist,$+(*,.,$2),0,w) {
.hdel +w Blacklist $+(*,.,$2)
.notice $nick 6Channel4 $2 6removed from all networks on 4blacklist6.
}
else {
.notice $nick $2 not found in blacklist.
}
}
elseif $hfind(Blacklist,$+($2,.,$3),0) {
.hdel Blacklist $+($2,.,$3)
.notice $nick Channel $3 on network $2 removed from blacklist.
}
else {
.hsave -o Blacklist Blacklist.hsh | .hload Blacklist Blacklist.hsh
.notice $nick Channel $3 on network $2 not found on blacklist.
}
else {
.notice $nick Channel $3 on network $2 not found on blacklist.
}
}
elseif ($1 == !add) {
if !$3 {
.hadd -m Blacklist $+($network,.,$2)
.hadd -m Blacklist $network $addtok($hget(Blacklist,$network),$2,44)
.notice $nick Channel $2 added for Network $network
}
else {
.hadd -m Blacklist $+($2,.,$3)
.hadd -m Blacklist $2 $addtok($hget(Blacklist,$2),$3,44)
.notice $nick Channel $2 added for Network $3
}
}
.hsave -o Blacklist Blacklist.hsh | .hload Blacklist Blacklist.hsh
}
}
That way the conditions that were repeated in your code are only executed once.
|
|
|
|
Joined: Aug 2006
Posts: 44
Ameglian cow
|
OP
Ameglian cow
Joined: Aug 2006
Posts: 44 |
Ok, but none of these solve my problem.
Newbie Scripter. Learning pretty fast...lol :P
|
|
|
|
|