|
Joined: Oct 2003
Posts: 64
Babel fish
|
OP
Babel fish
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)
|
|
|
|
Joined: Oct 2003
Posts: 8
Nutrimatic drinks dispenser
|
Nutrimatic drinks dispenser
Joined: Oct 2003
Posts: 8 |
be more clear i dont understand
thnx
|
|
|
|
Joined: Jan 2003
Posts: 3,012
Hoopy frood
|
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:
/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:
/passtopic {
var %topic = $chan($1).topic
/topic $1 $replace(%topic, $calc($findtok(%topic, PW:, 1, 32) + 1), $2)
}
then for your commands:
on *:TEXT:!ip *:#: {
if (*.*.*.* iswm $2) /iptopic $chan $2
else /msg $chan Invalid IP
}
on *:TEXT:!pass *:#: {
/passtopic $chan $2
}
-KingTomato
|
|
|
|
Joined: Oct 2003
Posts: 64
Babel fish
|
OP
Babel fish
Joined: Oct 2003
Posts: 64 |
ip works like a charm. pw dont work correctly
|
|
|
|
Joined: Oct 2003
Posts: 64
Babel fish
|
OP
Babel fish
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:
|
|
|
|
Joined: Jan 2003
Posts: 3,012
Hoopy frood
|
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...
/passtopic {
var %topic = $chan($1).topic
/topic $1 $puttok(%topic, $2, $calc($findtok(%topic, PW:, 1, 32) + 1), 32)
}
-KingTomato
|
|
|
|
Joined: Jan 2003
Posts: 3,012
Hoopy frood
|
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
|
|
|
|
Joined: Oct 2003
Posts: 64
Babel fish
|
OP
Babel fish
Joined: Oct 2003
Posts: 64 |
nah thats not what i mean...i actually gotta use it to call a wildcard...like this
/topic $chan $replace(%topic, PW:4 *, PW:4 $2)
|
|
|
|
Joined: Jan 2003
Posts: 3,012
Hoopy frood
|
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
/passtopic {
var %topic = $chan($1).topic
/topic $1 $puttok(%topic, $2, $calc($findtok(%topic, PW:4, 1, 32) + 1), 32)
}
-KingTomato
|
|
|
|
Joined: Oct 2003
Posts: 64
Babel fish
|
OP
Babel fish
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)
|
|
|
|
Joined: Jan 2003
Posts: 3,012
Hoopy frood
|
Hoopy frood
Joined: Jan 2003
Posts: 3,012 |
either $+() or $+
$+([],$2) [] $+ $2
-KingTomato
|
|
|
|
Joined: Oct 2003
Posts: 64
Babel fish
|
OP
Babel fish
Joined: Oct 2003
Posts: 64 |
thanks a lot...i have my bot working...thanks for all ur help man
|
|
|
|
Joined: Jan 2003
Posts: 3,012
Hoopy frood
|
Hoopy frood
Joined: Jan 2003
Posts: 3,012 |
-KingTomato
|
|
|
|
|