mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
#141325 08/02/06 02:38 PM
Joined: Feb 2006
Posts: 95
B
blk Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Feb 2006
Posts: 95
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..


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

#141327 08/02/06 02:44 PM
Joined: Feb 2006
Posts: 95
B
blk Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Feb 2006
Posts: 95
That fixes the space problem, anyway to send to specified channel?(that the bot is also in)


-blk-
#141328 08/02/06 02:49 PM
Joined: Jan 2006
Posts: 19
N
Pikka bird
Offline
Pikka bird
N
Joined: Jan 2006
Posts: 19
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,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
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
Joined: Feb 2006
Posts: 95
B
blk Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Feb 2006
Posts: 95
When i do that like !say #<chan> hey : it comes out with -
<bot> #chan hey

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


-blk-
#141331 08/02/06 03:21 PM
Joined: Jan 2006
Posts: 19
N
Pikka bird
Offline
Pikka bird
N
Joined: Jan 2006
Posts: 19
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,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
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
Joined: Feb 2006
Posts: 95
B
blk Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Feb 2006
Posts: 95
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.

-blk-
#141335 09/02/06 07:04 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
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
Joined: Feb 2006
Posts: 95
B
blk Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Feb 2006
Posts: 95
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?


-blk-
#141337 09/02/06 07:53 AM
Joined: Feb 2006
Posts: 95
B
blk Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Feb 2006
Posts: 95
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?


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


-blk-
#141339 09/02/06 06:10 PM
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
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
Joined: Feb 2006
Posts: 95
B
blk Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Feb 2006
Posts: 95
1 line scripts make it easier for me
That way just looks confusing to me...


-blk-
#141341 09/02/06 09:26 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
that maybe the case but your way doesnt work now does it!

#141342 09/02/06 09:27 PM
Joined: Feb 2006
Posts: 95
B
blk Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Feb 2006
Posts: 95
oh yea.. it works...


-blk-
#141343 09/02/06 09:30 PM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
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.


Gone.
#141344 09/02/06 09:43 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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