mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Code:
on op:text:!add network *:?:{
  if !$3-4 {
    .msg $nick Usage !add network <network> <server>
  }
  else {
    .hinc -m Network $3
    .hadd -m Network $+($3,.,$hget(Network,$3)) $4
    .msg $nick Network $3 with server address $4 has been added
  }
}
on op:text:!add room *:?:{
  if !$3 {
    .msg $nick Usage !add room (network) <room/channel>
    .msg $nick (network) will default to $network if not supplied
  }
  else {
    .hadd -m $iif(!$4,$network,$3) $iif(!$4,$3,$4)
    .msg $nick Room $iif(!$4,$3,$4) on $iif(!$4,$network,$3) has been added
  }
}
  


I don't get any error messages, but I don't get the confirmation message either, and when I go to check the hash tables, the entries aren't in them either.

A
Anonymous
Unregistered
Anonymous
Unregistered
A
maybe you should try testing with if ($3 == null || $4 == null)
i haven't tried it, but could work smile

btw, you've put ? so it only works on private messages, i hope you noticed that smile this could be the only source for errors, if nothing else is displayed onscreen. smile

Last edited by filip_xyz; 15/11/05 12:38 PM.
Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
The "op" user level does match for whoever is testing this for you right? I hope you don't mean channel op, because that isn't working in queries...

instead of if !$3-4 { use
if (!$4) {
If there's no $3, there's no $4 either smile
btw, I always surround my tests with ()

The first will not trigger on "!add network", because you have a space and then a * in the match text, so unless someone always ends his sentences with spaces (and probably doesnt use mIRC) it wont trigger on 2 words.

You have checked for another on TEXT trigger before this one that always matches and thus prevents the scripting engine from reaching this trigger?

Joined: Aug 2004
Posts: 7,252
R
RusselB Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
The user level is set properly, and my own tests, so I know I'm providing the proper information, aren't going through.

Regarding other ON TEXT events that might be matching, this is not possible, as those two are the first two ON TEXT events in my script.

I'll try the suggestion of checking !$4 rather than !$3-4, and try putting brackets in place. Hopefully one or a combination of those will get it to work.

OK. Changing !$3-4 to !$4 worked for the !add network, however, the !add room still isn't working.

Nevermind...dumb mistake on my part. Both codes now work properly.

Last edited by RusselB; 16/11/05 01:39 AM.
Joined: Mar 2005
Posts: 420
X
Fjord artisan
Offline
Fjord artisan
X
Joined: Mar 2005
Posts: 420
A suggestion when testing scripts, echo all the information being received and sent so you would what is wrong. smile


If you have a plastic floor runner over your tiles, then you're one Hella Pinoy!

Link Copied to Clipboard