Problem with gsub, < Characters>
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

Problem with gsub, < Characters>

Started by kepp, 10 December, 2003, 20:16:38

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

kepp

I want to do something like this

function DataArrival(user, data)
    if (strsub(data,1,1) == "<") or (strsub(data,1,4) == "$To:") then
          data=strsub(data,1,strlen(data)-1)

          local _,_,arg = strfind(data,"%b<>(.*)")

          if arg ~= nil then
arg = gsub(arg, "(%a)", "%1-%1")

                                           SendToAll(user.sName, arg) return 1
                                  end
                      end
          end

But im having a hard time Testing/Changing these:
"(%a)", "%1-%1")

What i don't understand is What "%1%2" does
Yea sure, i can see changes when i try other numbers...
But what exactly is it doing?
and also, if i would like to change the arg to UpperCase and lowercase letters,

Etc: HeLlO

If that is too hard to explain then just leave it, all i wanna know is what %2%1 does for inst
Guarding    

c h i l l a

#1
kepp you can search the LUA reference manual..  and you can look at this script made by plop
zcrazy

whitch should actually, be in the finished scripts section..
really a cool way of holding functions. and only usiing one string arrival..  I think I can use this :))

kepp

Oh, forgot about that one :) i'l take a look there to see if i get it!!
Thanks
Guarding    

plop

QuoteOriginally posted by c h i l l a
kepp you can search the LUA reference manual..  and you can look at this script made by plop
zcrazy

whitch should actually, be in the finished scripts section..
really a cool way of holding functions. and only usiing one string arrival..  I think I can use this :))
that has been the bot where i learned the most from.
it's a good idea of posting it in the finished section indeed.
should have a newer version also, added some more things.

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

SMF spam blocked by CleanTalk