command for search in reguser
 

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

command for search in reguser

Started by hermaniii, 01 December, 2007, 21:50:17

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

hermaniii


Search in all registerd users with part off the name and get a list off users that matches.
maybe something to add directly to the soft?

!find <part_of_nick>  or  !search/!finduser

min 2 char for search

//Herman

bastya_elvtars

This is for the new API:
-- RegSearch by bastya_elvtars
-- Requested by hermaniii

command = "searchreg" -- no trailing prefix!
minlen = 2 -- minimum search length

-- don't edit below

function ChatArrival (user, data)
  local cmd,str=data:match("^%b<>%s+[%!%+%#%?%-](%S+)%s(%S+)%|$")
  -- We are parsing the command here
  if cmd == command then
    if str:len() < 2 then
      Core.SendToUser(user, "<RegSearch> Search string must be at least "..minlen.." characters long!|")
    else
      local found
      local rettbl = {}
      local regusers = RegMan.GetRegs()
      for _,reg in ipairs(regusers) do
        if reg.sNick:find(str) then
          rettbl[reg.sNick] = ProfMan.GetProfile(reg.iProfile).sProfileName
          found = true
        end
      end
      if found then
        local msg = "<RegSearch> Found the following users:\r\n\r\n"..("-"):rep(60).."\r\n"
        for nick, prof in pairs (rettbl) do
          msg=msg..nick.."\t".."(Profile: "..prof..")\r\n"
        end
        msg=msg..("-"):rep(60).."|"
        Core.SendToUser(user,msg)
      end
    end
    return true
  end
end
Everything could have been anything else and it would have just as much meaning.

hermaniii


:/ was not a script req.
Have it already in my hub but thought it could be a good feature for the soft.

//Herman

bastya_elvtars

I think this should be done by a script, that's why Px has a nice scripting interface. Things that get into the main hubsoft are usually impossible or too slw via the Lua interface. And don't be so lazy to add a script. :P
Everything could have been anything else and it would have just as much meaning.

SMF spam blocked by CleanTalk