Author Topic: Create/login/save functions for zombie-account script  (Read 766 times)

0 Members and 1 Guest are viewing this topic.

Offline LORD KILLA

  • Camper
  • ***
  • Posts: 254
  • Happie
Create/login/save functions for zombie-account script
« on: April 18, 2009, 06:03:39 am »
Hi again!

Now i need some save/load from files function
it would be great if the functions could save/load INI files, i've already tried the ini functions by perro azul, but they dont work

Variables i have to save:
Money
Exp
MaxExp
Password
Mana
MaxMana
Skills[ID].Skills[1...]
...
Skills[ID].Skills[...12]

(skills are integer,

Offline tk

  • Soldier
  • **
  • Posts: 235
Re: Create/login/save functions for zombie-account script
« Reply #1 on: April 18, 2009, 06:51:06 am »
INI functions do work well but you cant use them then.
I wouldn't recommend using INI functions for saving accounts database because the are heavy. Much better will be xplit funcion only.

Example accounts text file including 3 players data:
Code: [Select]
//login pass_in_md5   money  exp   mexp mana  mmana  12 skills                   

asdf 93w7f493498saUf 1068044 48800 22000 34560 400500 1 0 0 0 1 0 0 1 0 1 0 1
fdsa 6dsrw7sdaUsdffd f625420 61045 68000 24000 500500 0 0 1 0 0 0 1 0 0 1 0 0
12de 8g97gd97f97gd8f 3028046 20000 24000 56455 200500 0 0 1 0 1 0 0 1 0 1 0 1

You split the file into single lines using xplit function,

lines:=xsplit(ReadFile(spawn_file), chr(13)+chr(10)); //lines are separated by ending line char

find a needed line by login which is on beginnig, and then split one line into single words getting the whole players data.

line:=xsplit(lines[num],' ');//words are separated by space

player[ID].pass := line[1];
player[ID].money := strtoint(line[2]);
...
...


« Last Edit: April 18, 2009, 07:22:27 am by tk »

Offline LORD KILLA

  • Camper
  • ***
  • Posts: 254
  • Happie
Re: Create/login/save functions for zombie-account script
« Reply #2 on: April 18, 2009, 07:03:51 am »
Thanks, but i still gotta problems,
ive already tried this. some **** way that dont work.
Gme an example, ok ?
save variable 'Money' and 'Level', other ill do myself ;)

Edit: Thanks :)
« Last Edit: April 18, 2009, 07:07:54 am by LORD KILLA »

Offline LORD KILLA

  • Camper
  • ***
  • Posts: 254
  • Happie
Re: Create/login/save functions for zombie-account script
« Reply #3 on: April 18, 2009, 07:09:19 am »
And how do i get the count of the seperated .... strings ?
GetArrayLength ?

Offline y0uRd34th

  • Camper
  • ***
  • Posts: 325
  • [i]Look Signature![/i]
Re: Create/login/save functions for zombie-account script
« Reply #4 on: April 18, 2009, 07:10:31 am »
uff. If you sometimes look in Scripting Releases you see easy Account Management Things.
-> Simple Database Functions
As the Name means, Simple