mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Oct 2008
Posts: 8
S
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Oct 2008
Posts: 8
Oper on a network, and constantly have people requesting new vhosts for ban evasion. So, thought I would make a script that would reject their vhost request based on host(if based on nick, which is what I first tried, they soon would just register a new nick). New to mirc scripting, and know this doesn't work, but was thinking the script would look along the lines of:

Code:
on *:TEXT:New vHost Requested by *:#: {
  .userhost $5
  if (HOST isin $2) { .msg hostserv reject $5 }
  ELSE { .msg hostserv activate $5}
}


I can tell the main problem is that $2 is looking back at the first on text statement instead of the /userhost, but don't know how else do it. Any help will be appreciated.

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
I would use raw numerics.
I think I see a few other problems with your code attempt, and I have done my best to resolve them here.
Personally, I would recommend limiting which channel(s) a person can request a new vhost in, as, at the moment, they would be able to do it in any channel that the client running this code is also in.

Code:
on *:text:New vHost Requests by*:#:{
  var %uhost = $5
  .userhost $nick
}
raw 302:*:{
  if $2 {
    .msg hostserv $iif(%uhost isin $3-,reject,activate) %uhost
  }
}


Joined: Oct 2008
Posts: 8
S
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Oct 2008
Posts: 8
Where would the specified host name go then?

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
In $5
Here's a re-write that makes the message clearer.

eg:
<RusselB> New vhost request for director@script.heaven.com

Code:
on *:text:New vHost Request for*:#:{
  var %uhost = $5
  .userhost $nick
}
raw 302:*:{
  if $2 {
    .msg hostserv $iif(%uhost isin $3-,reject,activate) %uhost
  }
}

Joined: Dec 2002
Posts: 2,033
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,033

That won't work with %uhost being set locally.

Last edited by RoCk; 08/01/09 03:33 AM.

Link Copied to Clipboard