mIRC Home    About    Download    Register    News    Help

Print Thread
#2449 18/12/02 06:55 PM
Joined: Dec 2002
Posts: 13
L
Lackey Offline OP
Pikka bird
OP Offline
Pikka bird
L
Joined: Dec 2002
Posts: 13
I wrote a simple text changing string. I use it two ways:
1. I input text and it says it in the channel all changed, depending on which way I pick.

2. I also have a greeter that uses those strings to randomly greet people in various ways.

My problem is I want to end the string, but add normal text in the same line. So it would looks something like:
Code:
Random blah: {
  set %blah.rand $rand(0,2)
  if ( %blah.rand == 0 ) { /greet1 blah blah $$1 } 
  if ( %blah.rand == 1 ) { /greet2 blah blah $$1 }
  if ( %blah.rand == 2 ) { /greet3 blah blah $$1 }
  

I just don't know how to end the string, then add the $$1 part as regular text. I either get the nick changed by the string as well, or the string ends but the identifier doesn't work.

#2450 18/12/02 08:47 PM
Joined: Dec 2002
Posts: 3
B
Self-satisified door
Offline
Self-satisified door
B
Joined: Dec 2002
Posts: 3
maybe look at the topic inthe search; On JOIN.
it uses a string with variables.
hope it helps.

#2451 18/12/02 09:16 PM
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
A couple of ideas spring to mind right offhand.
  • Have your greet alias check if ($isid) and return a value if so, otherwise, treat it as a command and msg $active or whatever you would normally do as usual.
    Code:
    
    alias greet1 {
      if ($isid) return $backwards($1-)
      else msg $active $backwards($1-)
    }
    
  • In your Random blah: popup, retrieve the data something like this:
    Code:
    
    Random blah: {
      msg $active $eval($+($,greet,$rand(0,2),(blah blah blah)),2) $1 $?="Anything else you have to say?"
    }


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C

Link Copied to Clipboard