Hopping for some help here... plz...
 

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

Hopping for some help here... plz...

Started by NightLitch, 17 October, 2003, 14:57:47

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

NightLitch

I have made an function that checks users password in RegisteredUsers.dat...

Now my problem... When I have regged a NEW user, and want to view that users name & password it doesn't show'n... why...

have tried with the

dofile(file)

but doesn't work... What is the solusion???

Have It loaded into a table...

How to reread the file.. help...

Cause it didn't work when using the same:

LoadRegFile(table,file) in Main in the function... nothing updated... :-(

plz help me out...

/NightLitch
//NL

pHaTTy

can you show us an example, im quite confused
Resistance is futile!

OpiumVolage

Copied from SlimV2 by trof. Take what you need in.

local temp={}
		TextLoad("../RegisteredUsers.dat",temp) 
		for x=1,getn(temp) do s,e,name,pass,level=strfind(temp[x],"(.-)\124(.-)\124(.+)")
			if (sarg==level) then showArray = { sName=name, sPass = pass, slevel = level} 
				if GetItemByName(name) then 
					botreplye=botreplye.."? "..name.." ? est en ligne\r\n"
				else
					botreplye=botreplye.."? "..name.." ? n'est pas en ligne.\r\n"
				end
			end
		end

function TextLoad(file,array,text)
	array[0]="" local x=0 
	readfrom(file) 
   	repeat if (text) then 
      		text=text..array[x].."\r\n"
   	end
   	x=x+1 array[x]=read() until (array[x]==nil)   
   	readfrom() 
   	return text 
end

plop

got the idea you want something like the next function does.
function FindPassword(nick)
   readfrom("../RegisteredUsers.dat")
   while 1 do
      local line = read()
      local who
      if line == nil then 
         readfrom()
         break 
      end
      s,e,who = strfind(line,"(.+)|.+|.+")
      if who == nick then
         s,e,password = strfind(line,".+|(.+)|.+")
         readfrom()
         break
      end
   end 
   return password
end
if you use tables 2 store usersnames in you have 2 reload them everytime a user is added (for safety it's better 2 totaly flush the table, specialy if you remove a user) or add/remove the user 2/from the table.
if you want i can strip that part from a.i.bot for you.

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 <----<<

NightLitch

ThX Guys That was the help I was looking for... Gonna ask later if I don't get it work properly as I want it to...

/NightLitch

(Sry for my english)
//NL

SMF spam blocked by CleanTalk