Jump to content

Pipe (|) Processing


Pablo

Recommended Posts

I have encountered a bug in my connection/script I need advice on...

 

For my channel protections (topic lock) I store the topic and modes for a channel to a hash on:JOIN. Well if a topic has a | or pipe in it, it makes the delimiters execute as commands.

 

For example:

 

  hadd cProt MODES $+ # $chan(#).mode
  .timer 1 1 hadd cProt TOPIC $+ # $chan(#).topic

 

Not sure why I use a timer on topic lol, but probably for a reason. Anyways, when a topic is "Blah | Help | Crap | Etc," mirc executes BLAH, HELP, CRAP, ETC.

 

How do i remove this without stripping out the pipes?

Link to comment
Share on other sites

are you using the latest version of mIRC.

I am not having that issue. If I understand what you are asking correctly. Let me know how this relates to what you are trying to do.

 

[07:07.a] err0r has changed the topic to: This is a test

[07:07.a] xerr0rx has changed the topic to: blah | another test | blah | hey

 

on ^*:topic:# { if ($hget(cprot,Topic $+ $chan) != $1-) { prop $chan TOPIC : $v1 } }

alias gettopic {
  hadd -m cProt TOPIC $+ $active $chan($active).topic | echo -a $hget(cprot,Topic $+ $active)
}

 

Where is your problem occurring. on the hadd or the check

Link to comment
Share on other sites

Guest Travis
I have encountered a bug in my connection/script I need advice on...

 

For my channel protections (topic lock) I store the topic and modes for a channel to a hash on:JOIN. Well if a topic has a | or pipe in it, it makes the delimiters execute as commands.

 

For example:

 

  hadd cProt MODES $+ # $chan(#).mode
  .timer 1 1 hadd cProt TOPIC $+ # $chan(#).topic

 

Not sure why I use a timer on topic lol, but probably for a reason. Anyways, when a topic is "Blah | Help | Crap | Etc," mirc executes BLAH, HELP, CRAP, ETC.

 

How do i remove this without stripping out the pipes?

 

Try not using a timer.

Link to comment
Share on other sites

i understand why you might do that in the onjoin .. but you are better off using the raw return to get the info when you join.

 

like raw 332 for topic and raw 324 for modes. It's a much better method for doing it than using on join:

 

if you just desire to use on join then you can do a timer on the alias instead of the actual event. Put the hadd in the alias and just timer to trigger the alias. Personally I would go with the raws though.

 

sorry i didn't notice this was in the general ircd area.. prop wouldn't work on it.

 

but why not just use chanserv to lock the modes/topic ????

Link to comment
Share on other sites

might also try waiting til you are op'ed instead of trying to do it on $me join

 

on !*:topic:# { if ($hget(cprot,Topic $+ $chan) != $1-) { topic $chan $v1 } }
on *:op:#: { if ($opnick == $me) && ($hget(cprot,Topic $+ $chan) != $chan(#).topic) { topic $chan $v1 } }

 

 

lots of different ways you could do it. Personally i would just use chanserv's lock features.

Link to comment
Share on other sites

Well you guys are awesome. I did both things.

 

I moved the hadd to raw and got rid of the timer. The timer was the culprit in handling the pipes. But regardless it is fixed and more efficient.

 

raw 324:*:{ hadd cProt MODES $+ $2 $3- }
raw 332:*:{ hadd cProt TOPIC $+ $2 $3- }

 

There are just soo many ways of doing the same thing, sometimes you need to think out of the box. And this was really for Buzzen, just didn't realize there was another forum.

Link to comment
Share on other sites

  • 3 months later...

FYI you could have just done this:

 

.timer 1 1 hadd cProt TOPIC $+ # $!chan( # ).topic

Timers evaluate everything twice (once at the time of the execution of the /timer command, and once again at the time the actual timer fires)... so you need to make sure anything you pass to it is escaped.

 

You can see what I'm talking about by typing these two lines of code in your status window:

 

//echo -a $!me

* this echoes the literal text "$me"

 

//.timer 1 1 echo -a $!me

* this echoes your nickname.

Link to comment
Share on other sites

timer still evaluates pipes ( | ).. I was not talking about !. The same example you posted unfortunately still evaluates the | symbol.

 

//.timer 1 1 echo -a hahha | hahha

/vs/

 

//echo -a hahha | hahha

returns the same result (error): "hahha - invalid command"

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...