mIRC Home    About    Download    Register    News    Help

Print Thread
I need help with $$1 and such. #145415 23/03/06 03:09 AM
Joined: Feb 2006
Posts: 47
F
FireDivine Offline OP
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?

Re: I need help with $$1 and such. #145416 23/03/06 03:31 AM
Joined: Feb 2006
Posts: 4
T
TheXX Offline
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-,*)
}
}

Re: I need help with $$1 and such. #145417 23/03/06 03:59 AM
Joined: Feb 2006
Posts: 47
F
FireDivine Offline OP
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!

Re: I need help with $$1 and such. #145418 23/03/06 09:55 AM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
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.

Re: I need help with $$1 and such. #145419 23/03/06 12:54 PM
Joined: Feb 2006
Posts: 47
F
FireDivine Offline OP
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. ^.^

Re: I need help with $$1 and such. #145420 23/03/06 07:04 PM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
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?