Skip to content
MSN

lists code

A TG007 community discussion started by DalienX.

Discussion 11 posts
Page 1 of 1
Open
Topic #3064 · 11 published posts · 1,012 views

Hi im having a little trouble with my lists code here..

 

on *:JOIN:#: { 
 if ($readini(Agold.ini,gold,$ial($nick,1).addr) != $null) { 
   if ($nick !isowner $chan) {
     mode $chan +q $nick
   }
 } 
}

this bit works fine

 

#aop on
on *:JOIN:#: {
 elseif ($readini(Adeop.ini,deop,$ial($nick,1).addr) != $null) {
   mode $chan -qo $nick
 } 
}
#aop end

but this one doesn't, can anyone see whats wrong with it?

 

You can't have elseif without an if.

It's like starting a sentence with "otherwise".

 

for what you're trying to do, you should probably change it to this

 

on *:JOIN:#: {
 if ($readini(Agold.ini,gold,$ial($nick,1).addr) != $null) {
   if ($nick !isowner $chan) {
     mode $chan +q $nick
   }
   else { mode $chan -qo $nick }
 }
}

Edited Mar 9, 2005 10:29 AM by Nimbus03

"the important thing was, that i had an onion on my belt, which was the style at the time"

woops thanks Cleric xtx, i didnt see that elseif lol.

 

nimbus i dont want to deop everyone, only certain people, but thanks anyway.

Im still having trouble with this access lists code.

 

.Auto gold
..Add:{ writeini Agold.ini gold $ial($1,1).addr $$1 | echo $active $$1 will be given gold on entry from now on } 
..Remove:{ remini Agold.ini gold $ial($1,1).addr | echo $active $$1 will no longer be given gold on entry } 
..Show list:{ run Agold.ini }
.Auto host
..Add:{ writeini Abrown.ini brown $ial($1,1).addr $$1 | echo $active $$1 will be given brown on entry from now on } 
..Remove:{ remini Abrown.ini brown $ial($1,1).addr | echo $active $$1 will no longer be given brown on entry }
..Show list:{ run Abrown.ini }
.Auto deop
..Add:{ writeini Adeop.ini deop $ial($1,1).addr $$1 | echo $active I will take $$1 $+ 's hammer on entry from now on } 
..Remove:{ remini Adeop.ini deop $ial($1,1).addr | echo $active I will no longer take $$1 $+ 's hammer on entry }
..Show list:{ run Adeop.ini }
-


on *:JOIN:#: { 
 if ($readini(Agold.ini,gold,$ial($nick,1).addr) != $null) { 
   if ($nick !isowner $chan) {
     mode %jc +q %joinnick
   }
 } 
 elseif ($readini(Abrown.ini,brown,$ial($nick,1).addr) != $null) {
   if ($nick !isop $chan) {
     mode %jc +o %joinnick
   }
 } 
 elseif ($readini(Adeop.ini,deop,$ial($nick,1).addr) != $null) {
   mode %jc -o %joinnick
 } 
 else { halt }
}

 

is there a better way to do this?

I take it from the lack of replys that the code is ok and should be working ??

I take it from the lack of replys that the code is ok and should be working ??

well for one, %jc isn't set so i would see how the code doesn't work. Try this instead. But by the way this coding was structured, i'm 100% sure this was taken out of a script which used this for a different purpose.

 

menu nicklist {
.Auto gold
..Add:{ writeini Agold.ini gold $ial($1,1).addr $$1 | echo $active $$1 will be given gold on entry from now on } 
..Remove:{ remini Agold.ini gold $ial($1,1).addr | echo $active $$1 will no longer be given gold on entry } 
..Show list:{ run Agold.ini }
.Auto host
..Add:{ writeini Abrown.ini brown $ial($1,1).addr $$1 | echo $active $$1 will be given brown on entry from now on } 
..Remove:{ remini Abrown.ini brown $ial($1,1).addr | echo $active $$1 will no longer be given brown on entry }
..Show list: run Abrown.ini
.Auto deop
..Add:{ writeini Adeop.ini deop $ial($1,1).addr $$1 | echo $active I will take $$1 $+ 's hammer on entry from now on } 
..Remove:{ remini Adeop.ini deop $ial($1,1).addr | echo $active I will no longer take $$1 $+ 's hammer on entry }
..Show list: run Adeop.ini
}
on *:JOIN:#: { 
if ($readini(Agold.ini,gold,$ial($nick,1).addr) != $null) && ($nick !isowner $chan) && ($me isowner $chan) mode $chan +q $nick
elseif ($readini(Abrown.ini,brown,$ial($nick,1).addr) != $null) && ($nick !isop $chan) && ($me isop $chan) mode $chan +o $nick
}

 

well for one, %jc isn't set so i would see how the code doesn't work. Try this instead. But by the way this coding was structured, i'm 100% sure this was taken out of a script which used this for a different purpose.

 

Well %jc is set when my script joins the channel, and %joinnick is set when anyone joins. but thanks ill try your version

and yes i wrote this based on a ban list i saw elsewhere

 

Edited Mar 24, 2005 2:50 PM by DalienX

ok well i had to add to your code a bit cause you missed the deop one.

 

on *:JOIN:#: {
 if ($readini(Agold.ini,gold,$ial($nick,1).addr) != $null) && ($nick !isowner $chan) && ($me isowner $chan) mode $chan +q $nick
 elseif ($readini(Abrown.ini,brown,$ial($nick,1).addr) != $null) && ($nick !isop $chan) && ($me isop $chan) mode $chan +o $nick
 elseif ($readini(Adeop.ini,deop,$ial($nick,1).addr) != $null) && ($nick isop $chan) && ($me isop $chan) mode $chan -o $nick
}

i followed the same format as your others but the deop doesnt work

on *:JOIN:#: {
if ($readini(Agold.ini,gold,$ial($nick,1).addr) != $null) && ($nick !isowner $chan) && ($me isowner $chan) mode $chan +q $nick
elseif ($readini(Abrown.ini,brown,$ial($nick,1).addr) != $null) && ($nick !isop $chan) && ($me isop $chan) mode $chan +o $nick
}

on *:oP:#: { if ($readini(Adeop.ini,deop,$ial($opnick,1).addr) != $null) && ($me isop $chan) { mode $chan -o $opnick } }

Edited Mar 25, 2005 2:27 PM by The Gate Keeper

Thanks, that works