PtokaX forum

PtokaX => Support => Topic started by: BrotherBear on 18 August, 2006, 18:45:43

Title: Profiles ?
Post by: BrotherBear on 18 August, 2006, 18:45:43
Hi!

How Many Profiles could you have in Ptokax?
Title: Re: Profiles ?
Post by: Herodes on 18 August, 2006, 19:01:16

--Just4Fun - CountHowManyProfilesICanAdd!
--- by Herodes ( request by BrotherBear )
--- 18/08/06

curProf = 0

function Main()
SetTimer( 1000 )
StartTimer()
for profile in ipairs(frmHub:GetProfiles()) do
RemoveProfile(profile)
end
end

function OnTimer()
AddProfile( ""..curProf.."", curProf)
curProf = curProf + 1
local handle = io.open("profs.txt", "w")
handle:write("Added "..curProf)
  handle:close()
end
try this one out .. I haven't tested ...
Title: Re: Profiles ?
Post by: 6Marilyn6Manson6 on 18 August, 2006, 21:12:28
Quote from: Herodes on 18 August, 2006, 19:01:16
Code (lua) Select

--Just4Fun - CountHowManyProfilesICanAdd!
--- by Herodes ( request by BrotherBear )
--- 18/08/06

curProf = 0

function Main()
SetTimer( 1000 )
StartTimer()
for profile in ipairs(frmHub:GetProfiles()) do
RemoveProfile(profile)
end
end

function OnTimer()
AddProfile( ""..curProf.."", curProf)
curProf = curProf + 1
local handle = io.open("profs.txt", "w")
handle:write("Added "..curProf)
  handle:close()
end
try this one out .. I haven't tested ...

Please herodes use only [ code] and not [ code=lua] in your post. Thanks
Title: Re: Profiles ?
Post by: Rincewind on 18 August, 2006, 21:21:09
Quote from: 6Marilyn6Manson6 on 18 August, 2006, 21:12:28
Please herodes use only [ code] and not [ code=lua] in your post. Thanks
Why? Using the code=lua copies like normal and makes it easier to read.
Title: Re: Profiles ?
Post by: BrotherBear on 18 August, 2006, 21:24:32
Thanks Herodes

But how do I use it?
Title: Re: Profiles ?
Post by: speedX on 18 August, 2006, 21:59:03
nope Rincewind....if u use
Code (lua) Select
thn in some cases it copies the whole code in one line....
Title: Re: Profiles ?
Post by: Rincewind on 18 August, 2006, 22:11:43
Not something I've seen happen. When I first saw it I copied some to see what would happen; it worked perfectly (or as well as normal anyway ;))
Title: Re: Profiles ?
Post by: Herodes on 19 August, 2006, 09:06:53
anyhow you can always try to quote the post and then copying the code from the reply page...
has anyone tried the script ?
Title: Re: Profiles ?
Post by: BrotherBear on 19 August, 2006, 09:30:02
Quote from: Herodes on 18 August, 2006, 19:01:16

--Just4Fun - CountHowManyProfilesICanAdd!
--- by Herodes ( request by BrotherBear )
--- 18/08/06

curProf = 0

function Main()
SetTimer( 1000 )
StartTimer()
for profile in ipairs(frmHub:GetProfiles()) do
RemoveProfile(profile)
end
end

function OnTimer()
AddProfile( ""..curProf.."", curProf)
curProf = curProf + 1
local handle = io.open("profs.txt", "w")
handle:write("Added "..curProf)
  handle:close()
end
try this one out .. I haven't tested ...

Hi Herodes :)

I don't know how to test this script :(

0 = Master
1 = OP
2 = VIP
3 = REG
4 = MOD
5 = NetFounder
6 = Owner
7 = SVIP
8 = KVIP

Is it possible to have it this way?
Title: Re: Profiles ?
Post by: Herodes on 19 August, 2006, 10:08:22
Quote from: BrotherBear on 19 August, 2006, 09:30:02
Hi Herodes :)

I don't know how to test this script :(

0 = Master
1 = OP
2 = VIP
3 = REG
4 = MOD
5 = NetFounder
6 = Owner
7 = SVIP
8 = KVIP

Is it possible to have it this way?

It is .. just go to the Profile Manager and add those ... make sure you set up the nessecary permissions for each profile....
But u asked for other information ... that I didn't know and I knew the way for you to find out ...

create an empty "profs.txt" file in the scripts folder and run the script
Title: Re: Profiles ?
Post by: BrotherBear on 19 August, 2006, 11:46:18
Quote from: Herodes on 19 August, 2006, 10:08:22
It is .. just go to the Profile Manager and add those ... make sure you set up the nessecary permissions for each profile....
But u asked for other information ... that I didn't know and I knew the way for you to find out ...

create an empty "profs.txt" file in the scripts folder and run the script

Ahh, great :)

I have created a "profs.txt" and started the script, but nothing happens :(

Something is strange here when I copy the script and paste it into Notepad it looks like this

--Just4Fun - CountHowManyProfilesICanAdd!--- by Herodes ( request by BrotherBear )--- 18/08/06 curProf = 0 function Main()   SetTimer( 1000 )   StartTimer()   for profile in ipairs(frmHub:GetProfiles()) do      RemoveProfile(profile)   endend function OnTimer()   AddProfile( ""..curProf.."", curProf)   curProf = curProf + 1   local handle = io.open("profs.txt", "w")   handle:write("Added "..curProf)     handle:close()end

It all came in 1 row.

And when I separate it so it looks like your script I get this error:

profiles.lua:10: attempt to call method 'GetProfiles' (a nil value)

I am Running Ptokax 0.3.5.1
Title: Re: Profiles ?
Post by: jiten on 19 August, 2006, 11:54:15
Quote from: BrotherBear on 19 August, 2006, 11:46:18
And when I separate it so it looks like your script I get this error:

profiles.lua:10: attempt to call method 'GetProfiles' (a nil value)

I am Running Ptokax 0.3.5.1

Rename frmHub:GetProfiles() to GetProfiles()
Title: Re: Profiles ?
Post by: Herodes on 19 August, 2006, 12:11:11
thx jiten,... I am at 2580 profiles and counting ... maybe someone with a faster pc can do it at a better rate .. I've set the timer to 10 ms ..
maybe there should be a limit on that ?

[update]Stopped at "Added 2805"
Title: Re: Profiles ?
Post by: Alexinno on 19 August, 2006, 12:53:26
BrotherBear, here is the Profiles.xml from Snooze's DixBot myabe you can use it :)

Profiles are
Owner
Master
SuperUser
Operator
KVIP
VIP
Reg


copy the Profiles.xml in Ptokax\cfg
Title: Re: Profiles ?
Post by: Madman on 19 August, 2006, 21:57:35
did to 5044 then i stopped it...
Title: Re: Profiles ?
Post by: bastya_elvtars on 20 August, 2006, 13:59:41
Oh my god,  if only I could fucking tell how much I hate write-only users...

Copying issues with GeSHi code (http://forum.ptokax.org/index.php?topic=6257.0)
Title: Re: Profiles ?
Post by: BrotherBear on 23 August, 2006, 15:29:28
Now it worked, I have reached over 20000 Profiles :)

Thanks Alexinno :)

If I wish to use the new profile in any script  is it only to add it like this:

EnableChatStats = {