mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2006
Posts: 47
F
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Feb 2006
Posts: 47
on *:TEXT:give* cookie*:#:{
if ($me == StupBot) {
/describe $chan *Gives $$1 $2 $3 $4 $5 $+ *
}
}

When you use all 5 $'s, it prints out:

*Gives something something something something something a cookie*

But when all the $'s are not used it adds a space:

*Gives soemthing something a cookie *

I think I know why, but does anyone know how to get rid of the space?

Joined: Feb 2006
Posts: 4
T
Self-satisified door
Offline
Self-satisified door
T
Joined: Feb 2006
Posts: 4
Yes, because it's filling the 5th parameter with a space.
First of all, don't use $$1 $2 $3 $4.
Use $1-
For Example:
on *:TEXT:Give*:#:{
if ($nick == StupBot) {
/describe $chan $+(*,$1-,*)
}
}

Joined: Feb 2006
Posts: 47
F
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Feb 2006
Posts: 47
I got it to work with:

on *:TEXT:Give* cookie*:#:{
if ($me == StupBot) {
/describe $chan $+(*,$$1-,*)
}
}

Thanks!

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Might as well use $1-, $$1- is pointless since $$1 well always exist becuase "Give* cookie*" means there has to be at least $1 and $2, $1 must start with GIVE and may have more characters following.

Joined: Feb 2006
Posts: 47
F
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Feb 2006
Posts: 47
I have been working on the code and got it like this:

on *:TEXT:Give* cookie*:#:{
if ($me == StupBot) {
/describe $chan $+(*,Gives $2-,*)
}
}

It works great. ^.^

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
looks good to me, as far as its worth persueing at least smile

<DaveC> Given that if i say the right thing I can make this cookie bot say something
* Stupbot *Gives that if i say the right thing I can make this cookie bot say something*
<DaveC> see what i mean?


Link Copied to Clipboard