mIRC Home    About    Download    Register    News    Help

Print Thread
#208601 24/01/09 03:36 PM
Joined: Oct 2008
Posts: 167
S
Vogon poet
OP Offline
Vogon poet
S
Joined: Oct 2008
Posts: 167
Code:
on *:text:#:* {
  if ($1 == !al) {
    .notice $nick The following list is for $chan $+ :
    .notice $nick = Auto Owner (~) =
    .notice $nick <1>
    .notice $nick = Auto Admin (&) =
    .notice $nick <2>
    .notice $nick = Auto Op (@) =
    .notice $nick <3>
    .notice $nick = Auto Hop (%) =
    .notice $nick <4>
    .notice $nick = Auto Voice (+) =
    .notice $nick <5>
    .notice $nick = END OF LIST =


This is for a replacement fantasy command.

I use the following scripts:
Code:
...
      elseif ($1 == !vop) && ($2 == add) { write $chan $+ .av.txt $3 | notice $nick $3 has been added to the autovoice list. | /mode $chan +v $3 }
      elseif ($1 == !vop) && ($2 == del) { write -ds $+ $3 $chan $+ .av.txt $3 | notice $nick $3 has been deleted from the autovoice list. | /mode $chan -v $3 }
      elseif ($1 == !hop) && ($2 == add) { write $chan $+ .ah.txt $3 | notice $nick $3 has been added to the auto-hop list. | /mode $chan +h $3 }
      elseif ($1 == !hop) && ($2 == del) { write -ds $+ $3 $chan $+ .ah.txt $3 | notice $nick $3 has been deleted from the auto-hop list. | /mode $chan -h $3 }
      elseif ($1 == !aop) && ($2 == add) && ($nick(#,$nick,a)) { write $chan $+ .ao.txt $3 | notice $nick $3 has been added to the auto op list. | /mode $chan +o $3 }
      elseif ($1 == !aop) && ($2 == del) && ($nick(#,$nick,a)) { write -ds $+ $3 $chan $+ .ao.txt $3 | notice $nick $3 has been deleted from the auto op list. | /mode $chan -o $3 }
      elseif ($1 == !sop) && ($2 == add) && ($nick(#,$nick,q)) { write $chan $+ .so.txt $3 | notice $nick $3 has been added to the auto-administration list. | /mode $chan +ao $3 $3 }
      elseif ($1 == !sop) && ($2 == del) && ($nick(#,$nick,q)) { write -ds $+ $3 $chan $+ .so.txt $3 | notice $nick $3 has been deleted from the auto-administration list. | /mode $chan -ao $3 $3 }
      elseif ($1 == !qop) && ($2 == add) && ($nick(#,$nick,q)) { write $chan $+ .qo.txt $3 | notice $nick $3 has been added to the auto-owner list. | /mode $chan +qo $3 $3 }
      elseif ($1 == !qop) && ($2 == del) && ($nick(#,$nick,q)) { write -ds $+ $3 $chan $+ .qo.txt $3 | notice $nick $3 has been deleted from the auto-owner list. | /mode $chan -qo $3 $3 }
...

(yes, I know about the ($nick(#,$nick,a)) still needs changed smile )

Then, when they join:
Code:
on *:join:#: {
  if ($me == no-nick)  {
    if ($read($chan $+ .so.txt,w,$nick)) { /mode # +ao $nick $nick }
  }
}

(repeated for each mode.)

The !al command I want to use as the replacement for !access list.
I do not know how to list all the names that are in the file... e.g. of how I want it to look..
Quote:
<User> !al
-no-nick- The following list is for $chan $+ :
-no-nick- = Auto Owner (~) =
-no-nick- Chris
-no-nick- Peer
-no-nick- = Auto Admin (&) =
-no-nick- bb9viewer
-no-nick- Jimmy
-no-nick- GNU43
-no-nick- = Auto Op (@) =
-no-nick- TXBrad
-no-nick- = Auto Hop (%) =
-no-nick- Brad
-no-nick- CM
-no-nick- Kyle
-no-nick- = Auto Voice (+) =
-no-nick- No Users.
-no-nick- = END OF LIST =


Thanks in advance for your help smile


Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
Maybe I'll write something up, but let me start by saying there are HUGE problems with your script, two of them being:
- not checking if parameters are present before executing a command
- giving people channel modes by nickname only, allowing VERY easily for your channel to be taken over

Joined: Oct 2008
Posts: 167
S
Vogon poet
OP Offline
Vogon poet
S
Joined: Oct 2008
Posts: 167
Yeah, I have currently only made it usable by one testing chat, I aim to add more to it to make it more secure in the future...

Just trying to take it a step at a time. wink

I don't think there is point to making it secure just now.

Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
One question, does the network you use it on use vhosts or not?

Joined: Oct 2008
Posts: 167
S
Vogon poet
OP Offline
Vogon poet
S
Joined: Oct 2008
Posts: 167
Yes, all networks I am on allow vHosts.

One of them (Ustream) allow temp. vHosts, which disappear when a user disconnects. They must join #vhosts and ask again. Kinda starts to defeat sometimes.

Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
Then you cannot run a secure auto-status script without people having to identify themselves.
*stops writing up his brilliant script :-\ *

Joined: Oct 2008
Posts: 167
S
Vogon poet
OP Offline
Vogon poet
S
Joined: Oct 2008
Posts: 167
idk how to use raws... but someone said 307 would check is someone was reg'ed on a network.

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
nah.. 307 returns a list of user's IP Addresses
http://www.mirc.net/raws/?view=307
If the network uses nickserv, you could use
Code:
/msg nickserv status <nick> 
then check the status notice returned by nickserv to see what level is returned. On the networks that I'm on and have seen this used before, it's always a number 0 - 3 (inclusive).
0 Not registered or not online
1 Not identified for the nick
2 The user is using an authorized address, although not identified as the owner of the nick.
3 The user has identified as the owner of the nick.

Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
In response to a /whois, RAW 307 indicates that a nick is registered (or possibly not registered in some cases).

Code:

<- :wildtime.beyondirc.net 307 genius_at_work genius_at_work :is a registered nick



-genius_at_work

Joined: Oct 2008
Posts: 167
S
Vogon poet
OP Offline
Vogon poet
S
Joined: Oct 2008
Posts: 167
I have been trying to figure how to use either of the methods to work...

Russel's method makes more sense to me, but I don't know how to put both methods into a bot.

Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
I don't really see the use. If a network supports nick registration, then it probably also supports channel access lists, making the script pretty useless.
If this were a script for a network without services there'd be a good point to it, imo.

Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
The response to /who also shows if a user is on a registered nick:

Code:

RAW 352:
<me> <channel> <ident> <host> <server> <nick> <HGr*@+> <hops> <Real Name->

H= Here
G= Away
r= Registered
*= IRCOp
@= Op in <channel>
+= Voice in <channel>
(additional flags may exist on other networks)



Joined: Oct 2008
Posts: 167
S
Vogon poet
OP Offline
Vogon poet
S
Joined: Oct 2008
Posts: 167
Some of the networks I am on don't have fantasy commands... others have services that keep failing... and some don't have it at all. (and yeah, they don't have services, but support vhosts smirk )

This script allows channels with the same name (e.g. #abc and #abc) to me mirrored with even less input across multiple networks.

It also helps because services bots usually have the "!topic" command, where as my bot has the, "!topic, !status, [...]" and when you use !topic then both bots change the topic, so fantasy commands get turned off... so this can be used as the replacement.

The lists can also be published online, and so can offer the chatroom owners to manage people via a website, and not just in the chatroom. (just as an extra)

Last edited by seanturner70; 25/01/09 08:43 PM.

Link Copied to Clipboard