mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2013
Posts: 9
R
r4z0r Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
R
Joined: Dec 2013
Posts: 9
Hey

I wonder how could I remove the hashtag (#) before the channel name in the below code, its a "just 4 fun" script :P

|
v

Code:
on *:JOIN:#: {
  if ($nick == $me) {
    msg $chan { Connecting to $chan . . . }
    timer 1 5 
    msg $chan { Connected Successfully! }
  }
}


As you can see the output contains a hashtag before the channelname.Is there a way I could remove it? Thanks in advance.

Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
$regsubex(#,^#*,)

Joined: Dec 2013
Posts: 9
R
r4z0r Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
R
Joined: Dec 2013
Posts: 9
Thanks for the help. Where/how could I insert that in the above code ? :P I am still learning msl..

Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
# is equivalent to $chan, so $regsubex(#,^#*,) is just $regsubex($chan,^#*,), so you would replace $chan in the code with that.
That said, the $regsubex might be incorrect, depending on how you want it to be...
For example, if the channel name is ##channel, that $regsubex will remove both '#'. Note that the channel name in this case is "#channel". If you want to simply remove the first '#' in this case you can simply use $mid($chan,2)



#mircscripting @ irc.swiftirc.net == the best mIRC help channel

Link Copied to Clipboard