help me with Hubtag
 

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

help me with Hubtag

Started by Themaster, 10 November, 2004, 19:40:27

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Themaster

Hey ppl.. i have made a regme function on my script.. But it don't past the Hubtag in the ptokax :s...

elseif cmd =="regme" and not user.bOperator then
		local _,_,cmd,AddPass = strfind( data, "%b<>%s+(%S+)%s+(.+)" )
		if (AddPass ~= nil and strfind(AddPass, "%W") == nil) then
			AddRegUser(user.sName, AddPass,3) 
			user:SendData(BotName," "..user.sName.."  *** You have been succesfull added as new Registred user!! ***")
         user:SendData(BotName, "Your password is:  "..AddPass.."  Reconnect and use that!!")
         user:SendData(BotName, "Your HubTag is: "..HubTag.." Put in to the favorits hub")
		else
			user:SendData(BotName," Syntax: !regme  ***");
		end
		return 1

;)
peace out...and love to your all scripter..that do the hard work  :D And all thx to your all there are here 2 help!!! :]

blade.lir.dk

((UKSN))shad_dow

dear TheMaster

heres a regme script i found in my scripts bank , hopefully u get the idea as it does what u wont and inforces the hub tag too

hope it helps

shad

------------------------------------------------------------------
--			Ozzy's
--			 __  __  ___  _  _  ___  ___   ___  _____  ___
--			|  \/  ||_ _|| \| ||_ _|| _ ) / _ \|_   _|/ __|
--			| |\/| | | | | .` | | | | _ \| (_) | | |  \__ \
--			|_|  |_||___||_|\_||___||___/ \___/  |_|  |___/
--
--		Minibots are a series of small helper bots for the
--		Ptokax DC hub program (ptokax.box.cz).
--		I write them while trying to understand how the hub works
--		and the language they are written in: Lua (www.lua.org).
--		Better bots can be found at lua.bcs-solutions.de.
------------------------------------------------------------------
--
--		Name:	REGGY
--		What:	To register users
--		How:	Use this code as a standalone minibot or cut and
--				paste the each piece into your main bot.
--		Where:	PtokaX Hub 0.3.2.6 TestDrive 4
--		Need:	File 'http.mod' in same directory as bot.
--
--                        Ricardo Menezes
--                            ("Ozzy")
--                            JUL/2003
--
--                     ???)(??`erra  (?\_)ova
--
--                  dchub://hub-terranova.no-ip.com
--                  http://web-terranova.no-ip.com
--
--                          Bras?lia, DF
--                             BRASIL
--
------------------------------------------------------------------

sBotName		= "Reggy"			-- Formal bot name.
bStartOnLine	= 1					-- Register bot at startup?
nRegUserIndex	= 3					-- Just to make sure it doesn't get mixed up
bForcePrefix	= 1					-- Make registered users wear hub prefix?
sHubPrefix		= "[???]"			-- The hub prefix
aHubMsg			= {
					BadRegCmd		= "Use !regme psw repeatpsw",
					PswDontMatch	= "Passwords don't match. Try again.",
					DupeUser		= "Can?t use your nick as it is. Logon again with a different one.",
					LogonAgain		= "Registration complete. Please logon again using your new nick.",
					DoneReg			= "Registration complete. Don't forget to use your password when you return.",
					RegNickUsed		= "Sorry... Only registered users may have a nick like yours. Try a different one."
					}

function Main()
------------------------------------------------------------------
	if (bStartOnLine) then
		frmHub:RegBot(sBotName)
	else
		frmHub:UnregBot(sBotName)
	end
end

function DataArrival(oUser,sData)
------------------------------------------------------------------
	
	local sNick = oUser.sName
	local _, _, sCmd, sArg = strfind(sData, "%b<>%s+(%S+)%s*([^|]*)%|$")

	if sCmd then
		sCmd = strlower(sCmd)
		if sCmd == "!regme" then											-- Cmd is register me?
																			-- Don't echo it back.
			local _, _, sPsw1, sPsw2 = strfind(sArg, "(%S+)%s+(%S+)")
			if sPsw1 and sPsw2 then											-- Both passwords present?
				if sPsw1 == sPsw2 then										-- Both passwords match?
					if bForcePrefix then									-- Is prefix mandatory?
						local sNewNick = sHubPrefix..sNick
						local oUserProfile = GetItemByName(sNewNick)
						if not oUserProfile then							-- Seat taken?
							AddRegUser(sNewNick, sPsw1, nRegUserIndex)		-- Register with new nick!
							oUser:SendData(sBotName, aHubMsg.LogonAgain)	-- Tell user to logon again.
							oUser:Disconnect()								-- This way the user will do as told.
						else
							oUser:SendData(sBotName, aHubMsg.DupeUser)		-- Show user already exists.
						end
					else
						AddRegUser(sNick, sPsw1, nRegUserIndex)				-- Register with same nick!
						oUser:SendData(sBotName, aHubMsg.DoneReg)			-- Tell user it's done.
					end
				else
						oUser:SendData(sBotName, aHubMsg.PswDontMatch)		-- Show psws must match.
				end
			else
					oUser:SendData(sBotName, aHubMsg.BadRegCmd)				-- Show proper syntax.
			end
			return 1														-- Quit processing cmds.
		end
	
	end

end

function NewUserConnected(oUser)
-------------------------------------------------
	local sNick = oUser.sName

	if bForcePrefix then									-- Is prefix being enforced?
		if (strfind(sNick, sHubPrefix)) and
			(oUser.iProfile ~= nRegUserIndex) then			-- Check nick
			oUser:SendData(sBotName, aHubMsg.RegNickUsed)	-- Say so
			oUser:Disconnect()
			return 1
		end
	end
end
creator of Therapy-X? bot

Themaster

#2
now there are 2 thinks that don't work...

  elseif cmd =="regme" and not user.bOperator then
		local _,_,cmd,AddPass = strfind( data, "%b<>%s+(%S+)%s+(.+)" )
		if (AddPass ~= nil and strfind(AddPass, "%W") == nil) then
			AddRegUser(HubTag .."user.sName".. AddPass,3) 
         user:SendPM(BotName," "..user.sName.."   You have been succesfull added as new Registred user!! ***")
         user:SendPM(BotName, "Your password is:  "..AddPass.."  Reconnect and use that!!")
         user:SendPM(BotName, "Your HubTag is: "..HubTag.." ")
         user:SendPM(BotName, "Please put the information into the favorits to this hub")
         return 1
		else
			user:SendData(BotName," Syntax: regme  ***");
		end
		return 1

and i can't get a login check off the hubtag

it is [BLA]nick

I DO NEED HELP
peace out...and love to your all scripter..that do the hard work  :D And all thx to your all there are here 2 help!!! :]

blade.lir.dk

((UKSN))shad_dow

#3
There ya go all fixed

HubTag = "[test]"

BotName = "Hubtag"
function DataArrival(user,data)

local _,_,cmd,AddPass = strfind( data, "%b<>%s+(%S+)%s+(.+)" )

if cmd =="+regme" and not user.bOperator then
		
		if (AddPass ~= nil and strfind(AddPass, "%W") ~= nil) then
			AddRegUser(HubTag..user.sName, AddPass, 3) 
         user:SendPM(BotName," "..HubTag..user.sName.."   You have been succesfull added as new Registred user!! ***")
         user:SendPM(BotName, "Your password is:  "..AddPass.."  Reconnect and use that!!")
         user:SendPM(BotName, "Please put the information into the favorits to this hub")
         return 1
		else
			user:SendData(BotName," Syntax: regme  ***");
		end
		return 1
end
end

yours

shad
creator of Therapy-X? bot

SMF spam blocked by CleanTalk