mIRC Homepage
Posted By: FireDivine I need help with $$1 and such. - 23/03/06 03:09 AM
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?
Posted By: TheXX Re: I need help with $$1 and such. - 23/03/06 03:31 AM
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-,*)
}
}
Posted By: FireDivine Re: I need help with $$1 and such. - 23/03/06 03:59 AM
I got it to work with:

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

Thanks!
Posted By: DaveC Re: I need help with $$1 and such. - 23/03/06 09:55 AM
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.
Posted By: FireDivine Re: I need help with $$1 and such. - 23/03/06 12:54 PM
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. ^.^
Posted By: DaveC Re: I need help with $$1 and such. - 23/03/06 07:04 PM
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?
© mIRC Discussion Forums