[PENNMUSH] Preserving % at input

Talvo Hornblower talvohornblower at hotmail.com
Tue Feb 8 21:20:41 CST 2005


Hi Jason,

You're right, having checked it it doesn't work as-is. Testing briefly on PennMUSH 1.8.0p1, though, it looks like this will work. 
(You'll need to totally erase your 'http*' command, and replace #12345 below with the right dbref.)

@hook/ignore huh_command=#12345,check_url
&check_url #12345=switch(%c,http://*,nsremit(%L,%n \(%#\) enters the URL: %c)0,1)

I'm not sure if that's really proper use of HUH_COMMAND, but it does seem to work.

Mike

----- Original Message ----- 
From: "Jason Newquist" <jason at nocturne.org>
To: "PennMUSH Mailing List" <pennmush at pennmush.org>
Sent: Wednesday, February 09, 2005 1:08 AM
Subject: Re: [PENNMUSH] Preserving % at input


> Hi,
>
> This could work!  Usage of %c seems to be a little tricky, since if you use it in a command (say, to set a variable), it evaluates 
> to the *variable setting command*.
>
> Can you recommend a usage which would capture $-command input?
>
> -Jason
>
>
> On Wed, 9 Feb 2005, Talvo Hornblower wrote:
>
>> Hi Jason,
>>
>> Instead of using 'http%0' when you trigger url_check, try using %c instead. That evaluates to the last command typed, before 
>> evaluation, so it should contain the exact URL they entered.
>>
>> Hope that helps,
>> Mike Griffiths
>>
>> ----- Original Message ----- From: "Jason Newquist" <jason at nocturne.org>
>> To: "PennMUSH Mailing List" <pennmush at pennmush.org>
>> Sent: Tuesday, February 08, 2005 10:00 PM
>> Subject: [PENNMUSH] Preserving % at input
>>
>>
>>> Greetings!
>>>
>>> We've had a nagging problem on my social MUSH for a while now, and I thought I might present it here to see if anyone can help 
>>> crack it.
>>>
>>> We have some code which allows people to simply paste a URL into the MUSH, thus:
>>>
>>>  &WWW3_CMD Globals = $http*:  @tr me/url_code =
>>>  http%0, %N, %#
>>>
>>> &url_code then takes these arguments, adds the link to a log, and presents the output to everyone in the room.  Kinda nice.  We 
>>> use it a great deal.
>>>
>>> However, many URLs contain percent signs (%20 for space being infamous, and other special cases abound), and this causes our 
>>> code above some trouble. According to DEBUG output, the percent signs are gone by the time we send %0 as an argument to 
>>> url_code --  the very first time we reference it.
>>>
>>> Is there anything we can do to preserve percentages given at input time, before they're evaluated and thus vanish?
>>>
>>> Jason Newquist
>>> San Francisco Bay Area
>>> _______________________________________________
>>> Pennmush mailing list
>>> Pennmush at pennmush.org
>>> http://www.pennmush.org/mailman/listinfo/pennmush
>>> PennMUSH FAQ-o-matic! http://www.pennmush.org/cgi-penn/fom
>>>
>> _______________________________________________
>> Pennmush mailing list
>> Pennmush at pennmush.org
>> http://www.pennmush.org/mailman/listinfo/pennmush
>> PennMUSH FAQ-o-matic! http://www.pennmush.org/cgi-penn/fom
>>
>
> Jason Newquist
> San Francisco Bay Area
> _______________________________________________
> Pennmush mailing list
> Pennmush at pennmush.org
> http://www.pennmush.org/mailman/listinfo/pennmush
> PennMUSH FAQ-o-matic! http://www.pennmush.org/cgi-penn/fom
> 


More information about the Pennmush mailing list