mIRC Home    About    Download    Register    News    Help

Print Thread
RolePlay Input Script #238559 08/08/12 04:26 PM
Joined: Jan 2012
Posts: 44
J
Jaillynian Offline OP
Ameglian cow
OP Offline
Ameglian cow
J
Joined: Jan 2012
Posts: 44
Okay. So I'm trying to code a simple replacement script... but what I've come up with so far is rather limiting in what I can do with it, and it gives me some side effects.

on *:INPUT:*: {
if (/me == $1) { return }
elseif (/* iswm $1) {
$$1 $replace($2-,",",::,6::)
halt
}
}

The reason I have it like this is I use it for aliases for roleplay.

like instead of typing a character name or using an IRC nick..

I'll type..

/dude hey!

and it'll come out

<That Dude> hey!

Now my script replaces :: with a colored version and " takes away all colors for text. I would like to somehow make it work with brackets ... for thought bubbles like .o( blah ) but with mirc coding it recognizes ( ) for code... so I can't do that. D:

Also when I type / and hold control to show the command instead of USING it, it ignores the control key and uses the command anyway..

Just curious if anyone had suggestions. I know it's a bit ridiculous. smile

Oh and my aliases are something like

/dude say <That Dude> $1-

Last edited by Jaillynian; 08/08/12 04:28 PM.
Re: RolePlay Input Script [Re: Jaillynian] #238562 08/08/12 10:09 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
For characters that can't be included directly, such as parentheses, just use the $chr() value for them.

( = $chr(40)
) = $chr(41)

For example:
$replace($1-,$chr(40),<,$chr(41),>)


Invision Support
#Invision on irc.irchighway.net
Re: RolePlay Input Script [Re: Riamus2] #238573 09/08/12 07:37 PM
Joined: Jan 2012
Posts: 44
J
Jaillynian Offline OP
Ameglian cow
OP Offline
Ameglian cow
J
Joined: Jan 2012
Posts: 44
Thanks. That might help me with... part of my problem but not the rest sadly.

Re: RolePlay Input Script [Re: Jaillynian] #238574 09/08/12 08:05 PM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
OH MY LORD.

ON INPUT is not meant to parse commands. Don't implement your own command parser. This is what aliases are for. Use it:

Code:
alias dude say $replace($1-,",",::,6::)


/dude hey!

If you already have a dude alias, just add the $replace part to your existing code and then you don't need a crazy on input script to do what aliases are already meant to do.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Re: RolePlay Input Script [Re: argv0] #238578 09/08/12 11:28 PM
Joined: Jan 2012
Posts: 44
J
Jaillynian Offline OP
Ameglian cow
OP Offline
Ameglian cow
J
Joined: Jan 2012
Posts: 44
Eh I have 300 dudes technically :P

Re: RolePlay Input Script [Re: Jaillynian] #238579 09/08/12 11:35 PM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Sounds like you should refactor them to use the same core code, then.

Code:
alias dude_text { return $replace($1-,",",::,6::) }
alias dude1 { say Something with $dude_text($1-) }
alias dude2 { say Something else with $dude_text($1-) }
alias dude3 { say Something else else with $dude_text($1-) }
alias dude4 { say Something else else else with $dude_text($1-) }
alias dude5 { say Something .... with $dude_text($1-) }
...


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Re: RolePlay Input Script [Re: argv0] #238580 09/08/12 11:52 PM
Joined: Jan 2012
Posts: 44
J
Jaillynian Offline OP
Ameglian cow
OP Offline
Ameglian cow
J
Joined: Jan 2012
Posts: 44
I'll test that out.

Tested it! Thanks. It works great.

Last edited by Jaillynian; 09/08/12 11:58 PM.
Re: RolePlay Input Script [Re: Jaillynian] #238592 11/08/12 12:42 AM
Joined: Jan 2012
Posts: 44
J
Jaillynian Offline OP
Ameglian cow
OP Offline
Ameglian cow
J
Joined: Jan 2012
Posts: 44
a friend of mine also pointed out something called regsub, saying it might turn off color coding after the second :: or so... but I have no idea how.. oh well I have things working in a way, so not gonna fuss.

Re: RolePlay Input Script [Re: Jaillynian] #239958 10/12/12 10:02 PM
Joined: Jan 2012
Posts: 44
J
Jaillynian Offline OP
Ameglian cow
OP Offline
Ameglian cow
J
Joined: Jan 2012
Posts: 44
I know I said I got it working before, but I felt like I should ask another question!

I want to make it work with $readini ... and I don't know how to do that at all.