Forum in READ ONLY mode! All questions and discussions on Discord official server, invite link: https://discord.gg/VxsGzJ7

поможет создать файл. | help to create file.

Ask for help
Post Reply
Hisered
Posts: 9
Joined: 02.06.2016 6:20

поможет создать файл. | help to create file.

Post by Hisered »

Hello all well!

I would like to help me create a .txt file using stealth.

I need the following functions.
. create a "file.txt"
. check if the file already exists on site.
. write in "file.txt"
. add the contents of "file.txt" in a variable.


------------


Привет. OK!

Я хотел бы, чтобы помочь мне создать файл .txt с помощью скрытности.

Мне нужны следующие функции.
, создать "file.txt"
, проверить, если файл уже существует на сайте.
, писать в "file.txt"
, добавить содержимое "file.txt" в переменной.

i am using pascal


Я использую Pascal
drabadan
Expert
Expert
Posts: 730
Joined: 13.12.2012 17:35
Contact:

Re: поможет создать файл. | help to create file.

Post by drabadan »

bad approach, don't use the files with some simple scripts!
For some complicated one there is a lot of solutions to do not use txt...

Would be better if you will tell us the idea you want to solve through a stealth.
User avatar
Vizit0r
Developer
Developer
Posts: 3958
Joined: 24.03.2005 17:05
Contact:

Re: поможет создать файл. | help to create file.

Post by Vizit0r »

no need to use gtranslate to russian, english lang enough.
check if the file already exists on site.
web-site or?

. write in "file.txt"
. add the contents of "file.txt" in a variable.
what is estimated content of file? string?
"Пишите код так, как будто сопровождать его будет склонный к насилию психопат, который знает, где вы живете". (с) Макконнелл, "Совершенный код".
Hisered
Posts: 9
Joined: 02.06.2016 6:20

Re: поможет создать файл. | help to create file.

Post by Hisered »

come on.
I will use only English.

I need a script that reads the gumpic as follows.

Ex:

Var line, color, loop: = 1: Integer;
color: = getgumpic (hue, line) // get the first color gumpic

While exist (gumpic (loop))
begin
  if (gumpic (hue) = color) and exist (gumpic (loop)) then
  begin
    write to a "file.txt" to cordenada X and Y of the current gumpic
  end
  else // means that the "hues" not equals "color"
  begin
    write to a "file.txt" to cordenada X and Y of the current gumpic
  end;
  loop: loop = +1 // always to go through here. jump pro next gumpic.
end;

Summary of this example above will do.
You will catch the "hues" of the first "gumpic" list of "infogump" and assign a variable.
while the "hues" of gumpic equals the "hues" setted in the variable.
it will run line by line picking up the x and y such gumpic and recording in a "file.txt".
When the hues not hit more to the value of variable setada soon the script from the beginning.
it will make a blank line and continue taking the x and y of the next gumpic's.
You will do this until the end gumpic.

have two days that started to use stealth and not getting to, or place thinking that teach treat "file.txt".

I really need a script to do this because I have an external program that treats this information.

I need also a script to get a string from a txt and add in a variable.
ex:
variable: = readln (patch + file.txt);
User avatar
Vizit0r
Developer
Developer
Posts: 3958
Joined: 24.03.2005 17:05
Contact:

Re: поможет создать файл. | help to create file.

Post by Vizit0r »

okey.

so, use TStringList class.

x : TStringList;

x := TStringList.Create;
x.LoadFromfile(path_to_file);
string_var := x.Lines[0];

x.Add(your_string);

x.SaveToFile(path_to_file);

x.Free;
"Пишите код так, как будто сопровождать его будет склонный к насилию психопат, который знает, где вы живете". (с) Макконнелл, "Совершенный код".
Hisered
Posts: 9
Joined: 02.06.2016 6:20

Re: поможет создать файл. | help to create file.

Post by Hisered »

Code:
Program New;
var
x : TStringList;
gi : TGumpInfo;
loop : integer;
text : Array[0..100] of String;
Result : UNICODESTRING;
begin
x := TStringList.Create;
x.LoadFromfile('d:\mani.txt');
GetGumpInfo(GetGumpsCount-1, gi);
Result := IntTOStr(Length(gi.GumpPics));
clientprint(Result+' size string');
for loop:= 0 to 1 do
begin
text[loop] := String(gi.GumpPics);
x.Add( text[loop] );
end;
x.SaveToFile('d:\mani.txt');
x.Free;
end.
Output:

Code: Select all

?
?
because can not I write the "GumpPics" in "txt [loop]" (mani.txt) ??
User avatar
Vizit0r
Developer
Developer
Posts: 3958
Joined: 24.03.2005 17:05
Contact:

Re: поможет создать файл. | help to create file.

Post by Vizit0r »

text[loop] := String(gi.GumpPics);
hidden error!




GumpPics : array of TGumpPic;
TGumpPic = record
x : Integer;
y : Integer;
id : Integer;
Hue : Integer;
Page : Integer;
ElemNum : Integer;
end;

so,

Code: Select all

Program New;
var
x : TStringList;
gi : TGumpInfo;
loop : integer;
text : Array[0..100] of String;
Result : String;
begin
  x := TStringList.Create;
  x.LoadFromfile('d:\mani.txt');
  GetGumpInfo(GetGumpsCount-1, gi);
  Result := IntTOStr(Length(gi.GumpPics));
  clientprint(Result+' size string');
  for loop:= 0 to 1 do  //are you sure, that 2 elements REALLY available? no checks, nothing.
  begin
    text[loop] := gi.GumpPics[loop].Hue.ToString;
    x.Add( text[loop] );
  end;
  x.SaveToFile('d:\mani.txt');
  x.Free;
end.
"Пишите код так, как будто сопровождать его будет склонный к насилию психопат, который знает, где вы живете". (с) Макконнелл, "Совершенный код".
Hisered
Posts: 9
Joined: 02.06.2016 6:20

Re: поможет создать файл. | help to create file.

Post by Hisered »

Thanks a lot for the help.
I am available to the community. to help as I can.
Post Reply