Skip to content
MSN Addons

one $m Join Scan trusted owners

A TG007 community discussion started by bonTy.

Discussion 32 posts
Page 2 of 2
Open
Topic #7057 · 32 published posts · 5,652 views

Wow, why would you use a variable for multiple people? That'd make your variables look messy, most likely incomplete, and it's a waste of space isnt it? You'd be better off making a txt or ini file .. but, if some of the code doesnt work, check your status window for error messages, and post em here. The code Entox|cated posted works fine.

 

exact, but i say that cause working with %var is easier :P

 

he can use txt and load it in hash table and look in if $adress isin with a while ...

 

and after on join if $adress isin hashtable blah...

 

 

like that (i didn't test the code, that's just an idea)

 

alias lookop { 
  if ($me isowner $chan) { 
    var %r = 1 
    while (0 <= $nick($chan,%r)) { 
      if ($adress isin $hget(oplist,nick. $+ $nick)) halt { 
        mode $msn.get($cid,fullroom) -oq $nick  | msg  $msn.get($cid,fullroom) not in my list ^^
      } 
      inc %r
    } 
  } 
} 
on *:start: { 
  hmake oplist 10 
  if ($exists(oplist.txt)) hload oplist oplist.txt 
} 
on *:Join:#: { 
  if ($me isowner $chan) { 
    lookop 
    if ($address isin $hget(oplist,nick. $+ $nick)) { 
       mode $msn.get($cid,fullroom) +q $nick 
      msg $msn.get($cid,fullroom) $nick is in oplist  
    } 
  } 
} 


Edited Jul 23, 2006 7:07 PM by Orus

Try using this one I modified from my original auto lister using hash tables. It is for Vincula. Tested and working.

alias scanowner {
  if ($me isowner $chan(1)) {
    var %n = 1
    echo -a scanowner completed
    while ($nick($chan(1),%n) >= 0) {
      if ($right($$ial($nick($chan(1),%n)),35) isin $hget(ownerlist,nick $+ $nick($chan(1),%n))) halt {
        .sockwrite -tn msn.server. $+ $cid mode $msn.get($cid,fullroom) -q $nick($chan(1),%n)
      }
      inc %n
    }
  }
}
on *:start: {
  hmake ownerlist 100 
  if ($exists(ownerlist.txt)) hload ownerlist ownerlist.txt
}
on *:Join:*: {
  if ($me isowner $chan) { 
    scanowner
    if ($address isin $hget(ownerlist,nick $+ $msn.decode($nick))) { 
      .sockwrite -tn msn.server. $+ $cid mode $msn.get($cid,fullroom) +q $nick 
      msg $chan Welcome Owner $nick 
    }
  }
}
on *:Owner:#: {
  if ($$ial($msn.ifdecode($nick,1)) isin $hget(ownerlist,nick $+ $msn.decode($nick))) halt
  else {
    .sockwrite -tn msn.server. $+ $cid mode $msn.get($cid,fullroom) -q $nick
    msg $chan You Are Not On My Ownerlist $nick.
  }
}
alias save return hsave -o ownerlist ownerlist.txt
alias list { dialog -m list list }
dialog list {
  title "Auto Lister"
  size -1 -1 200 100
  option dbu
  text "~Auto~Lister~by~Mail~ ~2006~", 80, 4 86 178 10
  button "Cancel", 43, 164 86 24 10, cancel

  tab "Owner", 100, 0 -5 198 86
  box Owner, 1, 2 10 195 70
  edit "Add Nick Here", 2, 4 22 150 10
  list 3, 4 32 150 40, size vsbar hsbar sort
  button "Add", 4, 164 22 24 10
  button "Remove", 5, 164 42 24 10
  button "Save", 6, 164 62 24 10
}
on *:dialog:list:init:*: {
  var %t = 1
  while ($hget(ownerlist,%t).item != $null) {
    did -a list 3 $hget(ownerlist,%t).data
    inc %t
  }
}
on *:dialog:list:sclick:4: { hadd -m ownerlist nick $+ $did(2) $$ial($did(2),1).addr | did -a list 3 $$ial($did(2),1).addr }
on *:dialog:list:sclick:5: { hdel ownerlist nick $+ $did(2) | did -d list 3 $did(3).sel | did -r list 2 $did(2) }
on *:dialog:list:sclick:6: { save }
menu nicklist { 
  LIST
  .Add Owner:hadd -m ownerlist nick $+ $$1 $$ial($$1,1).addr | hsave -o ownerlist ownerlist.txt
  .Remove Owner:hdel ownerlist nick $+ $$1 $$ial($$1,1).addr | hsave -o ownerlist ownerlist.txt
}
menu * {
  Auto Lister:/list
}

Edited Jul 25, 2006 9:59 AM by Mail

 

"Diplomacy is the art of saying 'Nice doggie' until you can find a rock".-Will Rogers

exact, but i say that cause working with %var is easier :P

 

he can use txt and load it in hash table and look in if $adress isin with a while ...

 

and after on join if $adress isin hashtable blah...

like that (i didn't test the code, that's just an idea)

 

alias lookop { 
  if ($me isowner $chan) { 
    var %r = 1 
    while (0 <= $nick($chan,%r)) { 
      if ($adress isin $hget(oplist,nick. $+ $nick)) halt { 
        mode $msn.get($cid,fullroom) -oq $nick  | msg  $msn.get($cid,fullroom) not in my list ^^
      } 
      inc %r
    } 
  } 
} 
on *:start: { 
  hmake oplist 10 
  if ($exists(oplist.txt)) hload oplist oplist.txt 
} 
on *:Join:#: { 
  if ($me isowner $chan) { 
    lookop 
    if ($address isin $hget(oplist,nick. $+ $nick)) { 
       mode $msn.get($cid,fullroom) +q $nick 
      msg $msn.get($cid,fullroom) $nick is in oplist  
    } 
  } 
} 

Hey Orus,

Thanks for the code, here is what I did and the code didn't work

alias lookop { 
  if ($me isowner $chan) { 
    var %r = 1 
    while (0 <= $nick($chan,%r)) { 
      if ($adress isin $hget(~script.trusted,nick. $+ $nick)) halt { 
        mode $msn.get($cid,fullroom) -oq $nick  | msg  $msn.get($cid,fullroom) not in my list ^^
      } 
      inc %r
    } 
  } 
} 
on *:start: { 
  hmake ~script.trusted 10 
  if ($exists(~script.trusted.txt)) hload ~script.trusted ~script.trusted.txt 
} 
on *:Join:#: { 
  if ($me isowner $chan) { 
    lookop 
    if ($address isin $hget(~script.trusted,nick. $+ $nick)) { 
      mode $msn.get($cid,fullroom) +q $nick 
      msg $msn.get($cid,fullroom) $nick is in oplist  
    } 
  } 
} 

If am mistaken plz let me know what to do , my trusted file name is "~script.trusted.txt

Thanks in advance!

 

Hey Mail,

I've tried your code too and it doesn't work too:( and I get this error

* /if: invalid format (line 27, autolister) and when a owner not added joins the room the script deowner itself and keep say you'r not operator

I am sorry guys if am being a bother:(

Edited Jul 24, 2006 9:24 AM by bonTy

Was missing one ). Should be fixed now.

 

"Diplomacy is the art of saying 'Nice doggie' until you can find a rock".-Will Rogers

fixed yea but still not working when I join with script the script deop itself not the other owner

 

fixed yea but still not working when I join with script the script deop itself not the other owner

 

Add ur script passport in the ".txt"?

 

As Orus stated you need to add your script to the hash table and it should work fine. I tested it a few times and it de-opped the script that was not added to the hash table upon joining everytime. You can add via a dialog or via the menu system. The dialog method will show you what passports or nicks are in the table.

Edited Jul 24, 2006 8:26 PM by Mail

 

"Diplomacy is the art of saying 'Nice doggie' until you can find a rock".-Will Rogers

Ok I added the script passport itself to the txt file and its the only one I added, I joined it doesn't doeop anyone at all.. and I get no errors..

dunno what to do else .

Ok I added the script passport itself to the txt file and its the only one I added, I joined it doesn't doeop anyone at all.. and I get no errors..

dunno what to do else .

 

 

Mails 's code is working in my script....

Its working fine in mine as well. I have no idea why it doesnt work for Bonty.

 

"Diplomacy is the art of saying 'Nice doggie' until you can find a rock".-Will Rogers

MAIL,

I and SamehSpiky Edited your code and it works just perfect now..

Here is the code

-

;Code By MAIL..
;Edited by SamehSpiky and bonTy
;
#scanowners on
alias scanowner { 
  var %c = $iif($1,$1,$active) 
  if ($me isowner $chan(%c)) { 
    var %n = 1 
    while ($nick($chan(%c),%n) >= 0) {
      if ($nick($chan(%c),%n) !isowner $chan(%c)) halt
      if ($nick($chan(%c),%n) != $me) && ($right($$ial($nick($chan(%c),%n)),35) !isin $hget(ownerlist,nick $+ $nick($chan(%c),%n))) { 
        .sockwrite -tn msn.server. $+ $cid access $msn.get($cid,fullroom) Clear OWNER
        .sockwrite -tn msn.server. $+ $cid MODE $msn.get($cid,fullroom) -q $nick($chan(1),%n)
        msg %c S \rTahoma;0 Sorry, $nick($chan(%c),%n) But you gotta subscribe to +q in $right(%c,-4) 
      } 
      inc %n 
    } 
    echo -a scanowner completed 
  } 
} 

on *:start: { 
  hmake ownerlist 100 
  if ($exists(ownerlist.txt)) hload ownerlist ownerlist.txt 
} 
on *:OWNER:*:{ 
  if ($opnick == $me) {
    .timerscan 1 3  { scanowner # }
  }
}
alias save return hsave -o ownerlist ownerlist.txt 
alias list { dialog -m list list } 
dialog list { 
  title "Auto Lister" 
  size -1 -1 200 100 
  option dbu 
  text "~Auto~Lister~by~Mail~ ~2006~", 80, 4 86 178 10 
  button "Cancel", 43, 164 86 24 10, cancel 

  tab "Owner", 100, 0 -5 198 86 
  box Owner, 1, 2 10 195 70 
  edit "Add Nick Here", 2, 4 22 150 10 
  list 3, 4 32 150 40, size vsbar hsbar sort 
  button "Add", 4, 164 22 24 10 
  button "Remove", 5, 164 42 24 10 
  button "Save", 6, 164 62 24 10 
} 
on *:dialog:list:init:*: { 
  var %t = 1 
  while ($hget(ownerlist,%t).item != $null) { 
    did -a list 3 $hget(ownerlist,%t).data 
    inc %t 
  } 
} 
on *:dialog:list:sclick:4: { hadd -m ownerlist nick $+ $did(2) $$ial($did(2),1).addr | did -a list 3 $$ial($did(2),1).addr } 
on *:dialog:list:sclick:5: { hdel ownerlist nick $+ $did(2) | did -d list 3 $did(3).sel | did -r list 2 $did(2) } 
on *:dialog:list:sclick:6: { save } 
#scanowners end
menu nicklist { 
  LIST 
  .Add Owner:hadd -m ownerlist nick $+ $$1 $$ial($$1,1).addr | hsave -o ownerlist ownerlist.txt 
  .Remove Owner:hdel ownerlist nick $+ $$1 $$ial($$1,1).addr | hsave -o ownerlist ownerlist.txt 
} 
menu * { 
  Auto Lister:/list 
} 

 

Thanks MAIL for your nice work and for your time coding the neat piece

and thanks for SamehSpiky for editing it to work with me!

 

I Edited the code again to halt scanning all room so now it will just scan owners!

Edited Jul 29, 2006 4:26 PM by bonTy

Okay now, I finished my own code which have my needs..

Thanks To MAIL for the Idea..

Thanks to Samehspiky for fixing the code to work with the $active because I had problems with this.

 

and here is my work

*\
bonTy
/*
;MAIL's IDEA.
;fixed by Samehspiky $active window
#scanowners on
alias scanowner { 
  var %c = $iif($1,$1,$active) 
  if ($me isowner $chan(%c)) { 
    var %n = 1 
    while ($nick($chan(%c),%n) >= 0) {
      if ($read(~script.trust.txt,s,$msngkshort($nick($chan(%c),%n)))) halt
      if ($nick($chan(%c),%n) !isowner $chan(%c)) halt
      if ($nick($chan(%c),%n) != $me)  { 
        .sockwrite -tn msn.server. $+ $cid access $msn.get($cid,fullroom) Clear OWNER
        .sockwrite -tn msn.server. $+ $cid access $msn.get($cid,fullroom) ADD DENY $nick($chan(1),%n) 
        .sockwrite -tn msn.server. $+ $cid access $msn.get($cid,fullroom) ADD DENY $right($$ial($nick($chan(%c),%n)),35) 
        .sockwrite -tn msn.server. $+ $cid KICK $msn.get($cid,fullroom) $nick($chan(1),%n) : $+ Sorry, but you are not in safe list!
        msg %c S \rTahoma;0 $nick($chan(%c),%n) Is not subscribed to +q in $right(%c,-4) 
      } 
      inc %n 
    } 
    echo -a scanowner completed 
  } 
}
on *:OWNER:*:{ 
  if ($opnick == $me) {
    .timerscan 1 3  { scanowner # }
  }
}
#scanowners on
*\
bonTy
/*

 

Note:

this code will not work with unless you have the same way I add in my trusted owner file...

 

if anyone want to use this feature please. use the one above THIS POST by MAIL..

Thanks for all who tried to help!.

Edited Jul 29, 2006 5:41 PM by bonTy