mIRC Home    About    Download    Register    News    Help

Print Thread
#52794 07/10/03 01:50 AM
Joined: Oct 2003
Posts: 64
E
Exlax Offline OP
Babel fish
OP Offline
Babel fish
E
Joined: Oct 2003
Posts: 64
How do i get the bot, which has op, to to put a piece of text inside a part of the topic

Topic to begin with:
IP: x.x.x.x || PW: *****

When a user says
!ip (an ip here)
i want the the text after IP: to change the the ip in the command

same for the !pw (the pw)

#52795 07/10/03 02:07 AM
Joined: Oct 2003
Posts: 8
J
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
J
Joined: Oct 2003
Posts: 8
be more clear i dont understand

thnx

#52796 07/10/03 04:08 AM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
* KingTomato changes topic to 'This is some topic || Here is the IP: 1.2.3.4 || Some more Topic'
(Typed: //iptopic # 4.3.2.1)
* KingTomato changes topic to 'This is some topic || Here is the IP: 4.3.2.1 || Some more Topic'
* KingTomato changes topic to 'New Topic With Different IP Position || Some Other Topic And new Order || The IP: 1.2.3.4'
(Typed: //iptopic # 4.3.2.1)
* KingTomato changes topic to 'New Topic With Different IP Position || Some Other Topic And new Order || The IP: 4.3.2.1'

Here is the alias im calling:

Code:
/iptopic {
  var %topic = $chan($1).topic
  /topic $1 $replace(%topic, $wildtok(%topic, *.*.*.*, 1, 32), $2)
}


Hopefully thats what u wanted.

-
EDIT: As for password, try this:

Code:
/passtopic {
  var %topic = $chan($1).topic
  /topic $1 $replace(%topic, $calc($findtok(%topic, PW:, 1, 32) + 1), $2)
}


then for your commands:

Code:
on *:TEXT:!ip *:#: {
  if (*.*.*.* iswm $2) /iptopic $chan $2
  else /msg $chan Invalid IP
}

on *:TEXT:!pass *:#: {
  /passtopic $chan $2
}


-KingTomato
#52797 07/10/03 11:52 PM
Joined: Oct 2003
Posts: 64
E
Exlax Offline OP
Babel fish
OP Offline
Babel fish
E
Joined: Oct 2003
Posts: 64
ip works like a charm.
pw dont work correctly

#52798 08/10/03 12:16 AM
Joined: Oct 2003
Posts: 64
E
Exlax Offline OP
Babel fish
OP Offline
Babel fish
E
Joined: Oct 2003
Posts: 64
what is the function to have a string include wildcards???

I want
PW: *

to not look for an asterisk sign, but i want it to act as a wildcard for finding anything that begins with PW:

#52799 08/10/03 12:17 AM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
My mistake, I used $replace as well as I forgot find return the token number, not tis value >:D

Sry for the trouble...

Code:
/passtopic {
  var %topic = $chan($1).topic
  /topic $1 $puttok(%topic, $2, $calc($findtok(%topic, PW:, 1, 32) + 1), 32)
}


-KingTomato
#52800 08/10/03 12:18 AM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
use iswm. Example:

var %string = IP: 12.34.56.78
if (IP: * iswm %string) { } ; this would return true, and execute the if block


-KingTomato
#52801 08/10/03 03:18 AM
Joined: Oct 2003
Posts: 64
E
Exlax Offline OP
Babel fish
OP Offline
Babel fish
E
Joined: Oct 2003
Posts: 64
nah thats not what i mean...i actually gotta use it to call a wildcard...like this
Code:
/topic $chan $replace(%topic, PW:4 *, PW:4 $2)

#52802 08/10/03 03:20 AM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
If The alias I gave you still doesn't work, change the PW: to the PW:[]4 (Add the color code) and it should work.

Edit

Code:
/passtopic {
  var %topic = $chan($1).topic
  /topic $1 $puttok(%topic, $2, $calc($findtok(%topic, PW:4, 1, 32) + 1), 32)
}


-KingTomato
#52803 08/10/03 03:54 AM
Joined: Oct 2003
Posts: 64
E
Exlax Offline OP
Babel fish
OP Offline
Babel fish
E
Joined: Oct 2003
Posts: 64
ok i edited code a bit, i just need to know 1 thing...

how do i put a bold code before $2 and make it still work

[]$2 turns out $2 (with bold)
instead of the actual second word (in bold print)

#52804 08/10/03 03:55 AM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
either $+() or $+

$+([],$2)
[] $+ $2


-KingTomato
#52805 08/10/03 10:39 AM
Joined: Oct 2003
Posts: 64
E
Exlax Offline OP
Babel fish
OP Offline
Babel fish
E
Joined: Oct 2003
Posts: 64
thanks a lot...i have my bot working...thanks for all ur help man

#52806 08/10/03 12:15 PM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
NP, Glad to be here >:D


-KingTomato

Link Copied to Clipboard