mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
#141325 08/02/06 02:38 PM
B
blk
blk
B
Now I want to have me command !say <chan> <message>
from me to my bot, then the bot messages the chan...

and I still need help sending a message with spaces, like the
one above, but just to the chan the command was sent in...

PS.
-sorry bout all the questions...lol
just getting into scripting and having a few problems..

#141326 08/02/06 02:41 PM
Joined: Sep 2005
Posts: 2,630
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,630
Code:
on *:text:!say &amp; ?*:#:{
  if ($nick == blk) msg $2-
}

#141327 08/02/06 02:44 PM
B
blk
blk
B
That fixes the space problem, anyway to send to specified channel?(that the bot is also in)

#141328 08/02/06 02:49 PM
N
NeoNY
NeoNY
N
Code:
on *:text:!say &amp; ?*:[color:red]#[/color]:{  if ($nick == blk) msg $2-}
  


on red put your Channel name you want its to respond...

#141329 08/02/06 02:49 PM
Joined: Sep 2005
Posts: 2,630
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,630
That's what I just gave you but I'll add some error checking..

Code:
on *:text:!say &amp; ?*:#:{
  if ($me ison $2) &amp;&amp; ($nick == blk) .msg $2-
}


Type !say <channel> <message>

#141330 08/02/06 02:59 PM
B
blk
blk
B
When i do that like !say #<chan> hey : it comes out with -
<bot> #chan hey

and doesn't send it to the channel...

#141331 08/02/06 03:21 PM
N
NeoNY
NeoNY
N
Code:
on *:text:!say ?*:#*: {  
if ($me ison $2) &amp;&amp; ($nick == blk) .msg $2- }
}
  


try this one....

cmd !say #<Chan> msg-here

Last edited by NeoNY; 08/02/06 03:33 PM.
#141332 08/02/06 05:22 PM
Joined: Sep 2005
Posts: 2,630
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,630
Then you have a custom msg alias.

Change the script to:

Code:
on *:text:!say &amp; ?*:#:{
  if ($nick == blk) &amp;&amp; ($me ison $2) !.msg $2-
}

#141333 08/02/06 05:40 PM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
NeoNY your putting a * (wildcard) in with the # doesn't help.
the # in that case with no channel name IS a wildcard and so the * is not needed.

Incorrect: on *:text:!say ?*:#*: {
Correct: on *:text:!say ?*:#: {

#141334 09/02/06 06:29 AM
B
blk
blk
B
on *:text:!say & ?*:#:{ if ($nick == blk) && ($me ison $2) !.msg $2- } works perfectly...

Now I want to know how to send a message the command is sent in...

I came up with on *:text:!say & ?*:#:{ if ($nick == BL4CK) && ($me ison $2) !.msg $2- } { .msg $chan Sending Message... }

It works, but I want to add the chan in the sending <chan> message...

Last edited by blk; 09/02/06 06:30 AM.
#141335 09/02/06 07:04 AM
Joined: Aug 2004
Posts: 7,168
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,168
Code:
 on *:text:!say &amp;*:#:{
 if ($nick == bl4ck) &amp;&amp; ($me ison $2) {
 !.msg $2-
.msg $chan Sending $2 Message
}
}
 

#141336 09/02/06 07:47 AM
B
blk
blk
B
OK....
on *:text:!say & ?*:#:{ if ($nick == blk) && ($me ison $2) !.msg $2- } { .msg $chan Sending $2 Message... } - works..

but anybody that says "!say <chan> <message>" gets the
"Sending <chan> Message..." in the channel.... but it doesn't
send <message> to the <chan>... any way to block that too?

#141337 09/02/06 07:53 AM
B
blk
blk
B
Hmm... I got
on *:text:!say & ?*:#:{ if ($nick == blk) && ($me ison $2) !.msg $2- } { if ($nick == blk) .msg $chan Sending $2 Message... } - to work...

But looks like it could be shorter?

#141338 09/02/06 07:59 AM
B
blk
blk
B
OK... got it to
on *:text:!say & ?*:#:if ($nick == blk) && ($me ison $2) { !.msg $2- } { .msg $chan Sending $2 Message... }

#141339 09/02/06 06:10 PM
Joined: Oct 2005
Posts: 1,671
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,671
Try this one:

Quote:

on *:text:!say &*:#:{
if ($nick == bl4ck) && ($me ison $2) {
!.msg $2-
.msg $chan Sending $2 Message
}
}

(by RusselB)

There is no reason to have everything on one line. It just makes it more difficult to read and alter.

-genius_at_work

#141340 09/02/06 09:24 PM
B
blk
blk
B
1 line scripts make it easier for me
That way just looks confusing to me...

#141341 09/02/06 09:26 PM
D
DaveC
DaveC
D
that maybe the case but your way doesnt work now does it!

#141342 09/02/06 09:27 PM
B
blk
blk
B
oh yea.. it works...

#141343 09/02/06 09:30 PM
Joined: Feb 2004
Posts: 2,013
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Feb 2004
Posts: 2,013
Putting all your code on a single line isn't easier, in fact it's the worst thing you can do.

Harder to make changes, you don't have any logical sense of grouping with { } whereas if it's split on multiple lines, the mIRC editor will put indentation everywhere when pressing the {} button.

It's also harder to debug, to fix errors and especially to read. I can tell you right now, you'll get a lot more help when posting readable code here instead of all piped up code.

You may do whatever you want of course, but just know, if you post something with all lines piped up, I and many others won't even bother reading it.

#141344 09/02/06 09:43 PM
D
DaveC
DaveC
D
you forgot to say also use code tags, seeing 2 pages of code all slammed hard against the left edge is instanlty a I cant be bothered with that post action.

Page 1 of 2 1 2

Link Copied to Clipboard