mirror of
https://github.com/moparisthebest/Simba
synced 2025-01-30 14:50:18 -05:00
Renamed extensions
This commit is contained in:
parent
c379bbba23
commit
32811ad6b7
77
Tests/PS/BmpTest.simba
Normal file
77
Tests/PS/BmpTest.simba
Normal file
@ -0,0 +1,77 @@
|
||||
program new;
|
||||
//http://www.hawaiisunshine.org/wp-content/uploads/2008/12/sunshine1.jpg
|
||||
var
|
||||
Bmp : integer;
|
||||
x,y : integer;
|
||||
w,h : integer;
|
||||
begin
|
||||
Bmp := BitmapFromString(37, 32, 'beNqFl3lwVuUVxp93veu3f1' +
|
||||
'lI+EKCLCkIAuI6oIBl0ylWweJerSm2atAaUJYgZCMLBAKyTSAh+w4' +
|
||||
'ERKnUpWoXERSBjtailDVACLS17Tj+13NvpB3tTHvnzOTOzb3vL+c5' +
|
||||
'azIGaIDMYMwQ3BBSkSkD4J4xCa4gNKQBZTClTS5tMBNQgAAY6C3mG' +
|
||||
'cN/zP/Wf0o3373oK0mfM8/E1UMMAa0YmZKQ4pvz6DUHzAJM3wwmpH' +
|
||||
'/6t1j/D3f1He/Xyj/HFQgzhIEQEAHiQDIwAEjzbrjrQX2c7yNJwDn' +
|
||||
'/5vh+Tb5l/3Vx77mhdFDLEEMMSPdtMDAGmMAwXWOWxWfb4s6APT4a' +
|
||||
'S5iBCDgRLT8KnjhcEJEJIgvP/ieOccPgZpDrsO/FIGAUcI8TeMwJP' +
|
||||
'heOLI/FVkZj5YFAuWEscANTw8lDnEgcMgQeBDd9hQXjQggu6ack+z' +
|
||||
'b0u5enHpAEZADXA3MDwSWZgwtSB5aG4+VmoBxGOfgqYC2wVNrjIaJ' +
|
||||
'gQV/nKBdh7rnpMPKUecnGhCI044xdzZ9+5tV40ZXMPenIo/ujumRk' +
|
||||
'5oahA1cHCIEqsCqINZCV3Fpjhsp08CnDHe5RVAw86oeVLOoHN8W/T' +
|
||||
'+YywpWnMPfj2h/d/iTm3xBHAHcHUDT2mi3jrqmISgJVK2yXvFbqjd' +
|
||||
'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4Pma/' +
|
||||
'xNm4T1vGOqVNp5ZnCashLeWPf+47gnwIv/BWSck+g=');
|
||||
GetClientDimensions(w,h);
|
||||
if FindBitmapToleranceIn(bmp,x,y,0,0,w-1,h-1,25) then
|
||||
MoveMouse(x,y);
|
||||
end.
|
31
Tests/PS/ColourTest2.simba
Normal file
31
Tests/PS/ColourTest2.simba
Normal file
@ -0,0 +1,31 @@
|
||||
program new;
|
||||
var
|
||||
p1, p2: TPointArray;
|
||||
w, h: integer;
|
||||
i, col: integer;
|
||||
bmp: integer;
|
||||
|
||||
begin
|
||||
SetColorToleranceSpeed(2);
|
||||
bmp := LoadBitmap('/home/merlijn/Pictures/Mooi/Carina_1_by_Eeitam.png');
|
||||
SetTargetBitmap(bmp);
|
||||
GetClientDimensions(W, H);
|
||||
writeln(inttostr(w) + ' : ' + inttostr(h));
|
||||
|
||||
for i := 0 to 100 do
|
||||
begin
|
||||
col := Random(clWhite);
|
||||
writeln(inttostr(col));
|
||||
FindColorsTolerance(p1, col, 0, 0, W - 1, H - 1, 40);
|
||||
FindColorsToleranceOptimised(p2, col, 0, 0, W - 1, H - 1, 40);
|
||||
writeln(inttostr(length(p1)) + ' : ' + inttostr(length(p2)));
|
||||
if(length(p1) <> length(p2)) then
|
||||
writeln('wat!');
|
||||
|
||||
setlength(p1,0);
|
||||
setlength(p2,0);
|
||||
|
||||
end;
|
||||
|
||||
FreeBitmap(bmp);
|
||||
end.
|
21
Tests/PS/DeformedTest.simba
Normal file
21
Tests/PS/DeformedTest.simba
Normal file
@ -0,0 +1,21 @@
|
||||
program New;
|
||||
//Scar manual -> you have to pick x1,y1,x2,y2 yourself. (It's at the first bitmapa
|
||||
var
|
||||
Deformed ,x,y: integer;
|
||||
ThaTime : integer;
|
||||
i : integer;
|
||||
acc : extended;
|
||||
begin
|
||||
Deformed := BitmapFromString(25, 24, 'beNrN1UEKwCAMBMDtb/oO' +
|
||||
'r/0//U1pISCiYUnCIpU9eRgihgTg525HD6pnRKZIkKAWEYJmjXI1F' +
|
||||
'VV2IhQavpzX02M3XHOdEZmSoohj5bmUW3CWMi3rkDf+k1q1AiX/QS' +
|
||||
'21aqRFuRNssP2TQTv6suDmNVFcXi/8Qvf1');
|
||||
//Doing this same code in scar will result in invalid results, since
|
||||
//fast replacedolor didn't work alright, atleast for me.
|
||||
FastReplaceColor(Deformed,clblack,clwhite);
|
||||
FastReplaceColor(deformed,82647,clblack);
|
||||
ThaTime := GetSystemTime;
|
||||
FindDeformedBitmapToleranceIn(Deformed, x, y, 119, 538, 213, 613, 70, 10, True, acc);
|
||||
Writeln(inttostr(GetSystemTime - ThaTime));
|
||||
Writeln(floattostr(acc));
|
||||
end.
|
90
Tests/PS/FileTests.simba
Normal file
90
Tests/PS/FileTests.simba
Normal file
@ -0,0 +1,90 @@
|
||||
program Hoi;
|
||||
|
||||
{
|
||||
Description: Test file to test the consistency of
|
||||
the following Functions:
|
||||
|
||||
AppPath, DirectoryExists, FileExists, ExeExt,
|
||||
DirectorySeperator, OpenFile, CreateFile, RewriteFile,
|
||||
WriteFileString, ReadFileString, SetFileCharPointer,
|
||||
FileSize, EndOfFile, FileContents.
|
||||
|
||||
Notes:
|
||||
Needs: GetFiles.
|
||||
|
||||
Bugs:
|
||||
Using ./test as TestPath crashes on Linux.
|
||||
Usage:
|
||||
Run it. Set the TestPath to a different directory if you are on Windows. :)
|
||||
}
|
||||
|
||||
Const
|
||||
TestPath = './test';
|
||||
|
||||
fsFromBeginning = 0; // offset must be pos or 0
|
||||
fsFromCurrent = 1; // offset pos or neg
|
||||
fsFromEnd = 2; // offset only neg or 0
|
||||
|
||||
var
|
||||
s, s2: string;
|
||||
myFile, myFile2: Integer;
|
||||
|
||||
begin
|
||||
s := apppath;
|
||||
Writeln('Our current path is: ' + s);
|
||||
{ If DirectoryExists(s) Then
|
||||
writeln('Directory ' + s + ' exists.'); }
|
||||
|
||||
{ If FileExists(s + DirectorySeperator + 'Cogat' + ExeExt) Then
|
||||
writeln('We exist!'); }
|
||||
|
||||
myFile := CreateFile(TestPath);
|
||||
WriteFileString(myFile, 'wat');
|
||||
WriteFileString(myFile, 'watnumber2');
|
||||
CloseFile(myFile);
|
||||
|
||||
myFile := OpenFile(TestPath, False);
|
||||
ReadFileString(myFile, s2, 2);
|
||||
writeln('s2: ' + s2);
|
||||
CloseFile(myFile);
|
||||
|
||||
myFile := CreateFile(TestPath + '2');
|
||||
WriteFileString(myFile, 'wat222');
|
||||
|
||||
CloseFile(myFile);
|
||||
|
||||
// TestPath now contains; 'watwatnumber2'. We will make it write 'number',
|
||||
// and then 2.
|
||||
myFile := OpenFile(TestPath, False);
|
||||
SetFileCharPointer(myFile, 6, fsFromBeginning);
|
||||
ReadFileString(myFile, s2, 6);
|
||||
writeln('s2: ' + s2);
|
||||
s2 := '';
|
||||
|
||||
SetFileCharPointer(myFile, -1, fsFromEnd);
|
||||
ReadFileString(myFile, s2, 1);
|
||||
writeln('s2: ' + s2);
|
||||
CloseFile(myFile);
|
||||
|
||||
// myFile2 should be -1.
|
||||
myFile := RewriteFile(TestPath, False);
|
||||
myFile2 := RewriteFile(TestPath, False);
|
||||
writeln(inttostr(myFile) + ' : ' + inttostr(myFile2));
|
||||
|
||||
// myFile2 should be -1.
|
||||
myFile2 := OpenFile(TestPath, False);
|
||||
writeln(inttostr(myFile) + ' : ' + inttostr(myFile2));
|
||||
|
||||
// Now, we will test EndOfFile, and FileSize.
|
||||
|
||||
While Not EndOfFile(myFile) Do
|
||||
Begin
|
||||
ReadFileString(myFile, s2, 1);
|
||||
Writeln(s2);
|
||||
End;
|
||||
|
||||
CloseFile(myFile);
|
||||
|
||||
//Writeln(FileContents(TestPath));
|
||||
writeln('wat');
|
||||
end.
|
35
Tests/PS/FormTest.simba
Normal file
35
Tests/PS/FormTest.simba
Normal file
@ -0,0 +1,35 @@
|
||||
program new;
|
||||
var
|
||||
TempVar : Boolean;
|
||||
procedure OnClick(Sender : TObject);
|
||||
begin;
|
||||
TempVar := True;
|
||||
Writeln('YOU HAS CLICKED THE BUTTON');
|
||||
end;
|
||||
function x : Boolean;
|
||||
var
|
||||
MyForm : TForm;
|
||||
AButton : TButton;
|
||||
begin;
|
||||
TempVar := False;
|
||||
Result := false;
|
||||
MyForm := TForm.Create(nil);
|
||||
MyForm.Width := 250;
|
||||
MyForm.Height := 250;
|
||||
AButton := TButton.Create(MyForm);
|
||||
AButton.Parent := MyForm;
|
||||
Abutton.SetBounds(100,100,100,50);
|
||||
AButton.OnClick := @OnClick;
|
||||
AButton.Caption := 'Test';
|
||||
MyForm.ShowModal;
|
||||
MyForm.Free;
|
||||
Result := TempVar;
|
||||
end;
|
||||
var
|
||||
v : TVariantArray;
|
||||
begin
|
||||
if ThreadSafeCall('x',v) then
|
||||
Writeln('You clicked the button! WinnOr')
|
||||
else
|
||||
Writeln('You did not click the button, fail all the way');
|
||||
end.
|
6
Tests/PS/IncludeTest.simba
Normal file
6
Tests/PS/IncludeTest.simba
Normal file
@ -0,0 +1,6 @@
|
||||
program new;
|
||||
{.include test.mufa}
|
||||
begin
|
||||
Writeln(TestStr);
|
||||
Writeln(inttostr(MultiPly(500,-20)));
|
||||
end.
|
22
Tests/PS/MaskTest.simba
Normal file
22
Tests/PS/MaskTest.simba
Normal file
@ -0,0 +1,22 @@
|
||||
program new;
|
||||
//http://nl.wikipedia.org/wiki/Lily_Allen
|
||||
|
||||
var
|
||||
Bmp : integer;
|
||||
Mask : TMask;
|
||||
x,y : integer;
|
||||
i, ii : integer;
|
||||
w,h : integer;
|
||||
begin
|
||||
Bmp := BitmapFromString(107, 19, 'beNrtVkEOgCAM8/+fxoOJUYG' +
|
||||
'uWwZKbE9KtmYrHbBtgiAIgpCOckFiopdtZr/j2HhynBjYjmntJxaW' +
|
||||
'6BwJWC8eH6QU15gz0Zx9vFgX0Iwhs0CASRUW8CFmioB1JFisA5qRI' +
|
||||
'KvJQNKa5mEcyAhoauI6N8ymAlkxWpdtwgL2bhPXCJc7+E7JLNJsgG' +
|
||||
'qQgL1jhHwX4VJdBsNZMbN5D//m/ob5XzwDp40wfg/jW9g024hbuPd' +
|
||||
'ritabVqaAj7zYVyxg9fol4M8FFG7YAfIG00k=');
|
||||
Mask := CreateBitmapMask(Bmp);
|
||||
GetClientDimensions(w,h);
|
||||
// if FindBitmapMaskTolerance(Bmp,x,y,0, 0,w-1, h-1,1,5) then
|
||||
if FindMaskTolerance(Mask,x,y,0, 0,w-1, h-1,1,5) then
|
||||
MoveMouse(x,y);
|
||||
end.
|
148
Tests/PS/Neopets_old.simba
Normal file
148
Tests/PS/Neopets_old.simba
Normal file
@ -0,0 +1,148 @@
|
||||
program BankProblems;
|
||||
|
||||
// http://www.neopets.com/games/play.phtml?game_id=371
|
||||
|
||||
Const
|
||||
KeyDownUpSpeed = 1; // The Higher the "KeyDownUpSpeed", the slower the script is.
|
||||
|
||||
Type
|
||||
Door = record
|
||||
X: Integer;
|
||||
Y: Integer;
|
||||
DoorChar: Byte;
|
||||
IsOpen: Boolean;
|
||||
IsMonster: Boolean;
|
||||
WhatMonster: String;
|
||||
End;
|
||||
|
||||
Var
|
||||
Doors: Array [0..5] Of Door;
|
||||
|
||||
Procedure DeclareStuff;
|
||||
|
||||
Var
|
||||
I: Integer;
|
||||
Begin
|
||||
For I := 0 To 5 Do
|
||||
Begin
|
||||
Doors[I].X := 45 + I * 96;
|
||||
Doors[I].Y := 210;
|
||||
End;
|
||||
|
||||
Doors[0].DoorChar := 83;
|
||||
Doors[1].DoorChar := 68;
|
||||
Doors[2].DoorChar := 70;
|
||||
Doors[3].DoorChar := 74;
|
||||
Doors[4].DoorChar := 75;
|
||||
Doors[5].DoorChar := 76;
|
||||
End;
|
||||
|
||||
Function IsBadGuy(DN: Integer): Boolean;
|
||||
|
||||
Var
|
||||
TempColor: Array [0..11] Of Integer;
|
||||
I, x, y: Integer;
|
||||
H, S, L: Extended;
|
||||
Begin
|
||||
TempColor[0] := GetColor(Doors[DN].X, Doors[DN].Y);
|
||||
TempColor[1] := GetColor(Doors[DN].X, Doors[DN].Y-1);
|
||||
TempColor[2] := GetColor(Doors[DN].X-1, Doors[DN].Y);
|
||||
TempColor[3] := GetColor(Doors[DN].X, Doors[DN].Y+1);
|
||||
TempColor[4] := GetColor(Doors[DN].X+1, Doors[DN].Y);
|
||||
TempColor[5] := GetColor(Doors[DN].X, Doors[DN].Y-2);
|
||||
TempColor[5] := GetColor(Doors[DN].X-2, Doors[DN].Y);
|
||||
TempColor[6] := GetColor(Doors[DN].X+1, Doors[DN].Y+2);
|
||||
TempColor[7] := GetColor(Doors[DN].X+2, Doors[DN].Y);
|
||||
TempColor[8] := GetColor(Doors[DN].X, Doors[DN].Y-3);
|
||||
TempColor[9] := GetColor(Doors[DN].X-3, Doors[DN].Y);
|
||||
TempColor[10] := GetColor(Doors[DN].X+1, Doors[DN].Y+3);
|
||||
TempColor[11] := GetColor(Doors[DN].X+3, Doors[DN].Y);
|
||||
|
||||
For I := 0 To 11 Do
|
||||
Begin
|
||||
If SimilarColors(TempColor[I], 3055, 30) Then // Red Devil
|
||||
Begin
|
||||
Result := True;
|
||||
Doors[DN].WhatMonster := 'Devil';
|
||||
Exit;
|
||||
End;
|
||||
End;
|
||||
|
||||
For I := 0 To 11 Do
|
||||
Begin
|
||||
If SimilarColors(TempColor[I], 12841714, 40) Then // Squirrle
|
||||
Begin
|
||||
ColorToHSL(TempColor[I], H, S, L);
|
||||
If (L > 60) And (L < 95) Then
|
||||
If (H > 5 ) And (H < 30) Then
|
||||
If FindColorTolerance(x, y, 4092580, Doors[DN].X, Doors[DN].Y-1,
|
||||
Doors[DN].X + 20, Doors[DN].Y + 1, 40)
|
||||
Then
|
||||
Begin
|
||||
Result := True;
|
||||
Doors[DN].WhatMonster := 'Squirrle';
|
||||
Exit;
|
||||
End;
|
||||
End;
|
||||
End;
|
||||
|
||||
For I := 0 To 11 Do
|
||||
Begin
|
||||
If SimilarColors(TempColor[I], 28756, 30) Then // Green Monster
|
||||
Begin
|
||||
Result := True;
|
||||
Doors[DN].WhatMonster := 'Green Monster';
|
||||
Exit;
|
||||
End;
|
||||
End;
|
||||
|
||||
For I := 0 To 11 Do
|
||||
Begin
|
||||
If SimilarColors(TempColor[I], 794793, 30) Then // Mysterious Man
|
||||
Begin
|
||||
Result := True;
|
||||
Doors[DN].WhatMonster := 'Mysterious Man';
|
||||
Exit;
|
||||
End;
|
||||
End;
|
||||
|
||||
End;
|
||||
|
||||
Procedure HandleMonsters;
|
||||
|
||||
Var
|
||||
I, iX, iY, Time: Integer;
|
||||
|
||||
Begin
|
||||
For I := 0 To 5 Do
|
||||
Begin
|
||||
If IsBadGuy(I) Then
|
||||
Begin
|
||||
KeyDown(Doors[I].DoorChar);
|
||||
Wait(10 * KeyDownUpSpeed);
|
||||
KeyUp(Doors[I].DoorChar);
|
||||
End;
|
||||
End;
|
||||
End;
|
||||
|
||||
Procedure AddToGold;
|
||||
|
||||
Begin
|
||||
If GetColor(388, 25) = 0 Then
|
||||
Begin
|
||||
Wait(100);
|
||||
KeyDown(32);
|
||||
Wait(10 * KeyDownUpSpeed);
|
||||
KeyUp(32);
|
||||
End;
|
||||
End;
|
||||
|
||||
begin
|
||||
//ClearDebug;
|
||||
DeclareStuff;
|
||||
Repeat
|
||||
AddToGold;
|
||||
HandleMonsters;
|
||||
Wait(10);
|
||||
Until False;
|
||||
end.
|
5
Tests/PS/PathTest.simba
Normal file
5
Tests/PS/PathTest.simba
Normal file
@ -0,0 +1,5 @@
|
||||
program new;
|
||||
begin
|
||||
Writeln(AppPath);
|
||||
Writeln(ScriptPath);
|
||||
end.
|
159
Tests/PS/Several bitmap operations.simba
Normal file
159
Tests/PS/Several bitmap operations.simba
Normal file
@ -0,0 +1,159 @@
|
||||
program new;
|
||||
const
|
||||
SaveDir = 'C:\';
|
||||
var
|
||||
Bmpz : integer;
|
||||
Bmp2 : integer;
|
||||
w,h : integer;
|
||||
begin
|
||||
Bmpz := BitmapFromString(166, 73, 'beNq9Xf2PVeURtv+Jv' +
|
||||
'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' +
|
||||
'vuQhoFO4p+K0A0F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||||
'iqLTG/NhUmHhe6Ue8p7QSY9Now8N46JSXHtCD19QPCeQbvwKsZ/6u' +
|
||||
'NSon2nnNa6hXru00SJtTqTX9u9GMs76laW9lVI/z6YqO5mMNFMXGt' +
|
||||
'KiQ13pad7S9GZdOybKBsZxYAkYCtNKhM269j7xODrXaWV3/24k5Fq' +
|
||||
'MNstkTWv6dOio2jOhP3SyONIOimgXd/UBn68LDfIQ5O2EdMqWIeXB' +
|
||||
'xnwdeHRv04586KsJ4lykGwlG4dXQrhLmqbB6kU4sbZeUhryrrjtz9' +
|
||||
'8BRzWSbw4MJoLNacOfbqgsVyChtL9iJBZuIVm4QZTtLgZ6mHERqAd' +
|
||||
'YXo58Hd3vBTixVP4qGKr6stVNCGmGcxOgSu5F0PXzmWhSzxC405NX' +
|
||||
'R7isVD18cugaMXGZNuEwhQW650DVomyaWD9GNZDt8LIYhGWsDQU/D' +
|
||||
'lBjhJTpfLvR2ly2sNByiC00aQQsaGK4bSdWAhbwKA3ViodBP6O3Yh' +
|
||||
'XXQLjSaP4wN9ofrA9NO8hy6G0kjpBvoHgg6RTAxjukm/86vHcXZzq' +
|
||||
'xdc/Z2oA8MURpVTw8KHeNumsOzA2tHc4wy7Xdy51VpGboPTDBS8rA' +
|
||||
'NDT38OZpNFCQ36No1IuM/uum9YzuPPgcDPVw3EordY5tcrHQbFDrl' +
|
||||
'wpEjaAegN/Jmh4PuvIX81T6H8PAsvRuJpuph50AKvC4XejtHCDmMH' +
|
||||
'cAdgJ6i25n8ENAb9XeI8WV1IyF/KeUeaHGrq6xL7MQSaa601eFZ1Y' +
|
||||
'O23D4wtOGVzbL0ne+Z7BeqxVK6kWhRDKGbCiswGriULjSNw4Up7lo' +
|
||||
'5viB0xDJ+Jsc+7bkT4RLX3o1miBMt2I2ky7I605qItBB1QeiNMiKK' +
|
||||
'yqVVUYtAx0hoO72qiowv3oWm6rmU1sLQwhfvA6MZsFVlBCV0zd0Lh' +
|
||||
'bIKVYVo1J7E8Z+vC02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egawti01UJtJ3w4iIe2' +
|
||||
'ry1KUA7kh/QmPgetGv8Ew37Q1Qa9uRUUfsEZibUP/SZ1saRd9dbv1' +
|
||||
'gZVSTtuVpMt0PkzqE5VETZWA9ORAYtxORWo4HJuqd6EyhpGdBsanM' +
|
||||
'pM+fH7qXVRxSZ6WbsS9QJMebtBVLH1PqzZk07pdJOxutBsNn0huof' +
|
||||
'6H6avb2+2V0KYgqUdS1VFABNOoOkm3FI98BHDT0ADJgrLZi5G3j3a' +
|
||||
'Po+8BCV1cWQ==');
|
||||
SaveBitmap(bmpz,SaveDir + 'original.bmp');
|
||||
GetBitmapSize(bmpz,w,h);
|
||||
SetBitmapName(bmpz,'Invetory Bitmap');
|
||||
Writeln('Bitmap size: ('+inttostr(w) + ',' + inttostr(h) + ')');
|
||||
Bmp2 := CopyBitmap(bmpz);
|
||||
SetBitmapSize(Bmp2,w div 2, h div 2);
|
||||
SaveBitmap(bmp2,SaveDir + 'cut.bmp');
|
||||
StretchBitmapResize(Bmpz,w*2,h*2);
|
||||
SaveBitmap(bmpz,savedir + 'stretched.bmp');
|
||||
FreeBitmap(bmp2);
|
||||
Bmp2 := CopyBitmap(bmpz);
|
||||
StretchBitmapResize(bmp2,w div 2, h div 2);
|
||||
SaveBitmap(bmp2,savedir + 'stretchedSmall.bmp');
|
||||
SaveBitmap(ContrastBitmap(bmpz,50),savedir + 'Contrast.bmp');
|
||||
SaveBitmap(BrightnessBitmap(bmpz,150),savedir + 'Brightness.bmp');
|
||||
SaveBitmap(GreyScaleBitmap(bmpz),savedir + 'GreyScale.bmp');
|
||||
InvertBitmap(bmpz);
|
||||
SaveBitmap(bmpz,savedir + 'inverted.bmp');
|
||||
Invertbitmap(bmpz);//Invert back
|
||||
SaveBitmap(DesaturateBitmap(Bmpz),savedir + 'desaturate.bmp');
|
||||
SaveBitmap(RotateBitmap(Bmpz,0.30*pi),savedir + 'rotated.bmp');
|
||||
SaveBitmap(PosterizeBitmap(Bmpz,75),savedir + 'posterized.bmp');
|
||||
end.
|
142
Tests/PS/SimpleBMPLoader.simba
Normal file
142
Tests/PS/SimpleBMPLoader.simba
Normal file
@ -0,0 +1,142 @@
|
||||
program new;
|
||||
var
|
||||
Bmpz : integer;
|
||||
w,h : integer;
|
||||
begin
|
||||
Bmpz := BitmapFromString(166, 73, 'beNq9Xf2PVeURtv+Jv' +
|
||||
'zeKSYvZaNlc2/S4N22tmtoYE0NsLdYQQoiClpgNQaSUUpRSpFhC/a' +
|
||||
'yIX0QCVaOtxn/MYWd39rnPM/Pecz/OJm82994958z7vjPvfM+c1ZW' +
|
||||
'f/+RHOtZWd9vwD/T7eLT7Fz+9z/7G17g+LrYfbdC99ks3mvil2/jF' +
|
||||
'nxDP8YfbX/8Q/8WB/wro9KM/wQbOKmau42f33W0Dv6aXLTgcCu6Dz' +
|
||||
'6cbreDqYi3+tRttbm8nk9/YwxVcFG07ogORopitNieQjo/y22/jdH' +
|
||||
'XF1+W/2GSqDcSlxTPxK2IWf8Tf/bE+W7rXL/NpBDbjXzGlWMsD994' +
|
||||
'V0/av9//4h36N345LCFKfSjb+1bYlZuJoInTE8mPgj3qmcA8JOym+' +
|
||||
'cN8aBKm3IyycA36mVeMpUyaAvCJWFxfghPHk4i/+nDjODiKwr8tJ9' +
|
||||
'6RappMBnan2EdYdwPXG79Vp8pl3gKBuch+QVXZbn4OQKozjw5Gpxv' +
|
||||
'Lj7LR5VEp46XEYC1U7cnFRSNXdJBuvzjiNlAD0PBIx0PRo2ElvnIV' +
|
||||
'YqX2wK20YkTxw7z1KKr5efxohTlGGHM9/jzl3k1JVT73OdvuYrK7E' +
|
||||
'mcJjiA8h5l8h/Y47fmCD7rVV2MLxmUFIKrDiAJIUoyuJ//sHh07iA' +
|
||||
'DnG2mgXbmyAQ25PqCGCj4MWk4wHOnRfrKNbBRnugBODajWpyDOx6J' +
|
||||
'cFxG5LsvtjHXqba5HqNZWZ00FG3NlwiKdOrR879kKAjusd41MB4ZT' +
|
||||
'wCJNAJ+lmHwh6XB+U01OhQloidpTO3KEo9IrPK08IZQznidgkVkAs' +
|
||||
'vRPoJAdRhCknVElHaNVrgrYN4jvvXPzyy+sXLpw+ePCZOOmhHaWaD' +
|
||||
'G0mcuyYACIa9Rn/VwVdNZlNGhjtIgVMgdq9D3d7/GuwZeWcSOcE3f' +
|
||||
'l2KgiC49FRIu0F7QvcBNyTCnolvGg/U2VeMY57hRA//+/H3377+Xf' +
|
||||
'ffXn16uX19cP2+z133tlHB8DT5PMhso+FE1fvAx0nEIBQptB+kgqR' +
|
||||
'2hf+wD7Qg7E7n9c9JLUccYpfSbchXDfWTuoiYbzi2+lAiLduffjVV' +
|
||||
'5/Z+PrrG///381vvrl1/vypI0cOOKn31PqQqvGr/+Kma0y1P/SKtF' +
|
||||
'SDVbQaN0AaS+m8J3RHcSA9JHhqgqH8IuwTrvuvvc3SKzmOS3aIN25' +
|
||||
'cNaA2jMy++OITG8ZbbALvvXfppZeec2JDo6yN9MAv2dG+XWt77o4l' +
|
||||
'94eOoGMP8bA7OBSyZDlun7UNrW8m6JW2bBhfXbmLbEy1xJEe4mjPC' +
|
||||
'h3lAunGwTYrBIXINoifffafTz99+/r1d+2DDZvAzZsf4Bxee/WVo0' +
|
||||
'cPuTwNPKZKqdJe5WSYA/oYLFbaPdTYyX2UOvfmgI4ycbylaSvoCtG' +
|
||||
'I8bmhI64R47jViPRwfgZEA2fj2rUrNj766N+ffPyW/+JzsAn4HOxK' +
|
||||
'IzanNxLHhE3yppJvFsXWfNBRSJHninQGPBQdCL5FoJPrQP0D8TWsM' +
|
||||
'BJqC6499VeoDwcXHhANhA37YMO4x/vvv2HDtAWfQMzBJuBzOHv2Zb' +
|
||||
'cXnLfn7q8NXk2uP7xsKdDJzEdHRzdpCZJqscS1q+O0Kyy+IIDl7nx' +
|
||||
'YNx2gm7huQHS6+tcbr16+fO7Klb/beGXXbhs4B5tAzMFneODwkePH' +
|
||||
'/2TDFQn1/boGizo5mttLhK6OtdQ1gadvudDVxVTpS0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5' +
|
||||
'ORTbcU6EjGGmkNvdH4iY34TI7lRdautJ3mMqW/2KNu3LhqWoSxjkc' +
|
||||
'f/aWNxx77tQkRM/HMCjCV0iZm5gESWJpVRYnllM6kccnY9lmh0wKR' +
|
||||
'e7cx7nyP/H6zQg8nj1r6uNjKXojb/bjNCl19p2H9UYSUQqXE2I2Eb' +
|
||||
't78wCSF8RPTEIzPGOHdzrU4derU+fMqNOkJGqTT0LPvCbm/5oBOt6' +
|
||||
'fqGQ7PqKfUGqS3WdeeUhpJzMCIJ0VgGgYZibNCxwRmzLdHesPT3Y3' +
|
||||
'y42CPvXXrQ9MizMS7fPnctWtXjv3ldAqRTlA7kYZQkIp1l2h9oKf+' +
|
||||
'0tSxpnRVJaL0XztVu9A+B1ePCpRANGluIWEjkNR/5wODaTIPBoUpT' +
|
||||
'o3UGKs++89LpkWYvXD8r2dOX7igKoqWC6FnqZH3opusGJ8KPTXt0z' +
|
||||
'QDPEQVaMqPbUNHnoZZTMRh0LUb2lrci7FyrKroAx1v75q55WmeiZY' +
|
||||
'PhEx5+W9nz7x+MT1Zmp+GG6tFTMptiGBClQqSa0BXNSke8nC355Hx' +
|
||||
'A9XpJlyTQ2brXKy0oWMOW0U8eITTah3aQPJ4p9ArS7MT0Um+DlKck' +
|
||||
'C9R5Ut/Hk6qoLpZCAQhOjbK8EXhS1JH48mE1niUPeHhtdU+GCdNng' +
|
||||
'6s4lp1YBLcPqWGVYgVeXg61I6reBqKg6hfIH2JHqhphEo2iEdcL6p' +
|
||||
'eeCOlYaep11WBoWoUOBz6r9buj+sp+1cTpRqCW8tbSOugu9CZQzdq' +
|
||||
'9qljHOkQVaOHuhH63PrkkNO5rlCGWLv9qNWVdm1gNxnTSRWwqlI1K' +
|
||||
'q282MqzNBu1qFpnpL+0NS63ZO1z0EBsYJUH3lbVdA406KTEKm4jcW' +
|
||||
'20uaWjXepONNTjoaZAkobsqzyooPPIvyVDTG1D4iHtKtFxpto1hqM' +
|
||||
'bzUycQ2od49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+
|
||||
'm9FFyQuWIWhU84FUOdspksM4okml9bq4J+EmnE61lUI0J69vEdNUq' +
|
||||
'Q4lZpZG+tLhS++s2ClLUXE21Aqzg7ia7J6X1renO0Bmvuv8lGs5W3' +
|
||||
'xXcE6wyaNQKRduHgE6sW/fWSSLdbfWcTFXPsNJ5LO9wTAveUxcxvf' +
|
||||
'WV6psUv423Syd8dbLrO/HqwPu2RiQSilKMegawti01UJtJ3w4iIe2' +
|
||||
'ry1KUA7kh/QmPgetGv8Ew37Q1Qa9uRUUfsEZibUP/SZ1saRd9dbv1' +
|
||||
'gZVSTtuVpMt0PkzqE5VETZWA9ORAYtxORWo4HJuqd6EyhpGdBsanM' +
|
||||
'pM+fH7qXVRxSZ6WbsS9QJMebtBVLH1PqzZk07pdJOxutBsNn0huof' +
|
||||
'6H6avb2+2V0KYgqUdS1VFABNOoOkm3FI98BHDT0ADJgrLZi5G3j3a' +
|
||||
'Po+8BCV1cWQ==');
|
||||
GetBitmapSize(bmpz,w,h);
|
||||
Writeln(inttostr(w) + '-' + inttostr(h));
|
||||
SetBitmapSize(Bmpz,w div 2, h div 2);
|
||||
SaveBitmap(Bmpz,'/tmp/test.bmp');
|
||||
//FreeBitmap(Bmpz);
|
||||
Bmpz := LoadBitmap('/tmp/test.bmp');
|
||||
SetBitmapSize(bmpz,w,h);
|
||||
SaveBitmap(Bmpz,'/tmp/test2.bmp');
|
||||
end.
|
10
Tests/PS/Uptext.simba
Normal file
10
Tests/PS/Uptext.simba
Normal file
@ -0,0 +1,10 @@
|
||||
program new;
|
||||
var
|
||||
i,t:integer;
|
||||
begin
|
||||
t:=getsystemtime;
|
||||
for i := 0 to 100 do
|
||||
rs_getuptext;
|
||||
writeln(inttostr(round(getsystemtime - t) / 100));
|
||||
writeln(rs_getuptext);
|
||||
end.
|
44
Tests/PS/blackchat.simba
Normal file
44
Tests/PS/blackchat.simba
Normal file
@ -0,0 +1,44 @@
|
||||
program new;
|
||||
|
||||
const
|
||||
MCX1 = 4;
|
||||
MCY1 = 342;
|
||||
MCX2 = 514;
|
||||
MCY2 = 475;
|
||||
|
||||
Function TextCoords(textn: Integer): TPoint;
|
||||
Begin
|
||||
Result.X := 10;
|
||||
Result.Y := 347 + (14 * (textn - 1));
|
||||
End;
|
||||
|
||||
function GetChatBoxText(Line, TextCol: Integer): string;
|
||||
var
|
||||
P: TPoint;
|
||||
cArr: TPointArray;
|
||||
B: TBox;
|
||||
begin
|
||||
P := TextCoords(Line);
|
||||
if (FindColorsTolerance(cArr, TextCol, MCX1, P.y, MCX2, P.y + 13, 0)) then
|
||||
begin
|
||||
B := GetTPABounds(cArr);
|
||||
// Result := GetTextAt(B.x1 - 1, B.y1 - 1, 1, 3, 0, 0, 0, 100, 'SmallChars');
|
||||
|
||||
{Result := Trim(GetTextAtEx(B.x1 - 1, B.y1 - 2, 0, SmallChars, False, False,
|
||||
0, 1, TextCol, 80, False, tr_AllChars)); }
|
||||
end;
|
||||
end;
|
||||
|
||||
var
|
||||
bmp: integer;
|
||||
begin
|
||||
bmp := LoadBitmap('/home/merlijn/Programs/trunk/pics/17.bmp');
|
||||
SetTargetBitmap(bmp);
|
||||
// freebitmap(bmp);
|
||||
{ GetChatBoxText(8, 0); }
|
||||
|
||||
{SetDesktopAsClient; }
|
||||
|
||||
// uncomment this for exception
|
||||
freebitmap(bmp);
|
||||
end.
|
9
Tests/PS/colour conversions.simba
Normal file
9
Tests/PS/colour conversions.simba
Normal file
@ -0,0 +1,9 @@
|
||||
program new;
|
||||
var
|
||||
R,G,B : byte;
|
||||
begin
|
||||
ColorToRGB(clwhite,r,g,b);
|
||||
Writeln([r,g,b]);
|
||||
Writeln(RGBToColor(50,150,250));//16422450
|
||||
writeln(XYZToColor(0.5,0.7,0.9));//1513219
|
||||
end.
|
43
Tests/PS/colourtest.simba
Normal file
43
Tests/PS/colourtest.simba
Normal file
@ -0,0 +1,43 @@
|
||||
program new;
|
||||
var
|
||||
x,y,w,h,i,j,t,t2:integer;
|
||||
begin
|
||||
getclientdimensions(w,h);
|
||||
writeln(inttostr(w) + ', ' + inttostr(h));
|
||||
|
||||
freeze();
|
||||
for i := 0 to 2 do
|
||||
begin
|
||||
setcolortolerancespeed(i);
|
||||
t := getsystemtime;
|
||||
for j := 0 to 100 do
|
||||
findcolortolerance(x, y, 2532562, 0, 0, w -1 , h -1, 1);
|
||||
t2 := getsystemtime;
|
||||
writeln('Time for 101 tries: ' + inttostr(t2 - t) + ' ms.');
|
||||
writeln('That is ' + FloatToStr((t2 - t) / 101) + ' ms each.');
|
||||
|
||||
if findcolortolerance(x, y, 2532562, 0, 0, w-1, h-1, 1) then
|
||||
begin
|
||||
writeln('CTS: ' + inttostr(I) + '; Found the colour at (' + inttostr(x) + ', ' +
|
||||
inttostr(y) + ')');
|
||||
movemouse(x, y);
|
||||
wait(1000);
|
||||
end else
|
||||
writeln('not found');
|
||||
end;
|
||||
unfreeze();
|
||||
end.
|
||||
|
||||
Compiled succesfully in 7 ms.
|
||||
826, 597
|
||||
Time for 101 tries: 1143 ms.
|
||||
That is 11.316831683168 ms each.
|
||||
not found
|
||||
Time for 101 tries: 2565 ms.
|
||||
That is 25.396039603960 ms each.
|
||||
not found
|
||||
Time for 101 tries: 3799 ms.
|
||||
That is 37.613861386139 ms each.
|
||||
not found
|
||||
Succesfully executed
|
||||
|
21
Tests/PS/debugimageform.simba
Normal file
21
Tests/PS/debugimageform.simba
Normal file
@ -0,0 +1,21 @@
|
||||
program new;
|
||||
var
|
||||
Bmp,x,y : integer;
|
||||
DebugBmp : integer;
|
||||
begin
|
||||
Bmp := createbItmap(100,100);
|
||||
CopyClientToBitmap(Bmp,0,0,99,99);
|
||||
for x := 0 to 49 do
|
||||
begin;
|
||||
for y := 0 to 49 do
|
||||
begin;
|
||||
fastsetpixel(bmp,x,y,random(clwhite));
|
||||
fastsetpixel(bmp,y,x,random(clwhite));
|
||||
end;
|
||||
x := x + 5;
|
||||
end;
|
||||
DisplayDebugImgWindow(100,100);
|
||||
DrawBitmapDebugImg(bmp);
|
||||
DebugBMP := GetDebugBitmap;
|
||||
SaveBitmap(DebugBmp,ScriptPath + 'debugimage.bmp');
|
||||
end.
|
24
Tests/PS/dtmtest.simba
Normal file
24
Tests/PS/dtmtest.simba
Normal file
@ -0,0 +1,24 @@
|
||||
program new;
|
||||
var
|
||||
dtm,x,y, w, h:integer;
|
||||
ppdtm:pdtm;
|
||||
begin
|
||||
getclientdimensions(w,h);
|
||||
writeln(inttostr(w) + ',' + inttostr(h));
|
||||
dtm := DTMFromString('78DA63F4606460F0634001E181810C46401A2' +
|
||||
'8C3F01F0818AD31D54064612490B601B28209A87105B2A209A8F1' +
|
||||
'23424D38901540841A2FFC6A00C8100982');
|
||||
|
||||
if finddtm(dtm, x,y, 0, 0, w-1,h-1) then
|
||||
begin
|
||||
writeln('found');
|
||||
movemouse(x,y);
|
||||
end else
|
||||
writeln('not found');
|
||||
if getdtm(dtm, ppdtm) then
|
||||
writeln('yay');
|
||||
printpdtm(tdtmtopdtm(pdtmtotdtm(ppdtm)));
|
||||
dtm := addpdtm(ppdtm);
|
||||
freedtm(dtm);
|
||||
// old dtm is not freed, since it is overridden by addpdtm.
|
||||
end.
|
61
Tests/PS/dtmtest2.simba
Normal file
61
Tests/PS/dtmtest2.simba
Normal file
@ -0,0 +1,61 @@
|
||||
program new;
|
||||
|
||||
const
|
||||
dtm_Rectangle = 0;
|
||||
dtm_Cross = 1;
|
||||
dtm_DiagonalCross = 2;
|
||||
dtm_Circle = 3;
|
||||
dtm_Triangle = 4;
|
||||
|
||||
var
|
||||
ppdtm: pdtm;
|
||||
w,h,x,y,dtm,i: integer;
|
||||
|
||||
a: extended;
|
||||
|
||||
p,pp: TPointArray;
|
||||
c,t,asz,ash: TIntegerArray;
|
||||
bp:array of boolean;
|
||||
|
||||
begin
|
||||
p := [Point(0,0), Point(1,1), Point(-4, -4)];
|
||||
c := [clWhite, clWhite, clWhite];
|
||||
t := [0, 0, 0];
|
||||
asz := [0, 4, 4];
|
||||
ash := [dtm_Rectangle, dtm_Rectangle, dtm_Rectangle];
|
||||
setlength(ppdtm.p,2);
|
||||
bp:=[false,false,false];
|
||||
|
||||
ppdtm.l := 3;//We have 3 points..
|
||||
ppdtm.p := p;
|
||||
ppdtm.c := c;
|
||||
ppdtm.t := t;
|
||||
ppdtm.asz := asz;
|
||||
ppdtm.ash := ash;
|
||||
ppdtm.bp := bp;
|
||||
ppdtm.n := 'TestDTM';//Our name!
|
||||
|
||||
dtm := AddpDTM(ppdtm);
|
||||
|
||||
getclientdimensions(w,h);
|
||||
writeln(inttostr(w) + ', ' + inttostr(h));
|
||||
|
||||
if FindDTM(dtm, x, y, 0, 0, w-1, h-1) then
|
||||
begin
|
||||
writeln('Found DTM at ' + inttostr(x) + ', ' + inttostr(y));
|
||||
movemouse(x,y);
|
||||
end;
|
||||
|
||||
if FindDTMs(dtm, p, 0, 0, w-1, h-1) then
|
||||
begin
|
||||
writeln('Found ' + inttostr(length(p)) + ' DTM(s). First one at ' +
|
||||
inttostr(p[0].x) + ', ' + inttostr(p[0].y));
|
||||
movemouse(p[0].x,p[0].y);
|
||||
end;
|
||||
|
||||
if FindDTMRotated(dtm, x, y, 0, 0, w-1, h-1, -3.14, 3.14, 0.05, a) then
|
||||
begin
|
||||
writeln('Found DTM at ' + inttostr(x) + ', ' + inttostr(y) + ' Angle: ' + FloatToStr(a));
|
||||
movemouse(x,y);
|
||||
end;
|
||||
end.
|
14
Tests/PS/loadsystemfont.simba
Normal file
14
Tests/PS/loadsystemfont.simba
Normal file
@ -0,0 +1,14 @@
|
||||
program new;
|
||||
var
|
||||
Font : TFont;
|
||||
begin
|
||||
Font := TFont.Create;
|
||||
Font.Name := 'Courier New';
|
||||
Font.Size := 10;
|
||||
Font.Style := [];
|
||||
LoadSystemFont(Font,'test');
|
||||
DisplayDebugImgWindow(0,0);
|
||||
DisplayDebugImgWindow(150,50);
|
||||
DrawBitmapDebugImg(BitmapFromText('BMP[0] has not been freed','test'));
|
||||
Font.free;
|
||||
end.
|
32
Tests/PS/mouse.simba
Normal file
32
Tests/PS/mouse.simba
Normal file
@ -0,0 +1,32 @@
|
||||
program Mouse;
|
||||
|
||||
{
|
||||
This program illustrates the Mufasa Mouse Functions
|
||||
}
|
||||
|
||||
var
|
||||
w, h, x, y: integer;
|
||||
begin
|
||||
getclientdimensions(w,h);
|
||||
writeln(inttostr(w) + ', ' + inttostr(h));
|
||||
MoveMouse(0, 0);
|
||||
getmousepos(x, y);
|
||||
writeln(inttostr(x) + ', ' + inttostr(y));
|
||||
wait(1000);
|
||||
MoveMouse(w, 0);
|
||||
getmousepos(x, y);
|
||||
writeln(inttostr(x) + ', ' + inttostr(y));
|
||||
wait(1000);
|
||||
MoveMouse(0, h);
|
||||
getmousepos(x, y);
|
||||
writeln(inttostr(x) + ', ' + inttostr(y));
|
||||
wait(1000);
|
||||
MoveMouse(w, h);
|
||||
getmousepos(x, y);
|
||||
writeln(inttostr(x) + ', ' + inttostr(y));
|
||||
wait(1000);
|
||||
ClickMouse(0, 0, mouse_Right);
|
||||
|
||||
for x := 0 to 400 do
|
||||
MoveMouse(x, x);
|
||||
end.
|
64
Tests/PS/plugintest.simba
Normal file
64
Tests/PS/plugintest.simba
Normal file
@ -0,0 +1,64 @@
|
||||
program new;
|
||||
{.LoadDLL libsmart}
|
||||
function IsKeyDown(C:Char): Boolean;
|
||||
begin
|
||||
Result := SmartIsKeyDown(ord(c));
|
||||
end;
|
||||
|
||||
procedure MoveMouse(x, y: Integer);
|
||||
begin
|
||||
SmartMoveMouse(x, y);
|
||||
end;
|
||||
|
||||
procedure HoldMouse(x, y: Integer; left: Boolean);
|
||||
begin
|
||||
SmartHoldMouse(x, y, left);
|
||||
end;
|
||||
|
||||
procedure ReleaseMouse(x, y: Integer; left: Boolean);
|
||||
begin
|
||||
SmartReleaseMouse(x, y, left);
|
||||
end;
|
||||
|
||||
procedure KeyUp(key: Byte);
|
||||
begin
|
||||
If Key = 13 Then
|
||||
Key := 10;
|
||||
SmartReleaseKey(key);
|
||||
end;
|
||||
|
||||
procedure KeyDown(key: Byte);
|
||||
begin
|
||||
If Key = 13 Then
|
||||
Key := 10;
|
||||
SmartHoldKey(key);
|
||||
end;
|
||||
|
||||
procedure SendKeys(S: String);
|
||||
begin
|
||||
SmartSendKeys(S);
|
||||
end;
|
||||
|
||||
procedure GetMousePos(var x, y: Integer);
|
||||
begin
|
||||
SmartGetMousePos(x, y);
|
||||
end;
|
||||
|
||||
function GetColor(x, y: Integer): Integer;
|
||||
begin
|
||||
result:= SmartGetColor(x, y);
|
||||
end;
|
||||
|
||||
|
||||
var
|
||||
w,h:integer;
|
||||
begin
|
||||
SmartSetup('http://world19.runescape.com/', 'plugin.js?param=o0,a1,m0', 765, 503);
|
||||
SetTargetArray(SmartImageArray, 765,503);
|
||||
getclientdimensions(w,h);
|
||||
writeln(inttostr(w) + ' , ' + inttostr(h));
|
||||
if findcolortolerance(w,h,clwhite,0,0,764,502,300) then
|
||||
smartmovemouse(w,h);
|
||||
savescreenshot('/tmp/smart.bmp');
|
||||
//Wait(5000);
|
||||
end.
|
17
Tests/PS/settings_test.simba
Normal file
17
Tests/PS/settings_test.simba
Normal file
@ -0,0 +1,17 @@
|
||||
program new;
|
||||
begin
|
||||
SettingsGetSetDefaultKeyValue('Kanker/wat', 'YO WAT');
|
||||
SettingsGetSetDefaultKeyValue('Kanker/wat2', 'YO WAT2');
|
||||
writeln(SettingsGetKeyValue('Kanker/wat'));
|
||||
|
||||
if SettingsIsDirectory('Kanker') then
|
||||
writeln('Kanker has at least one child!');
|
||||
if SettingsIsKey('Kanker/wat') then
|
||||
writeln('wat exists!');
|
||||
SettingsDeleteKey('Kanker/wat');
|
||||
writeln(SettingsGetKeyValue('Kanker/wat2'));
|
||||
writeln(SettingsGetKeyValue('Kanker/wat'));
|
||||
SettingsDeleteSubKeys('Kanker');
|
||||
if SettingsIsKey('Kanker') then
|
||||
writeln('kanker is a key now!');
|
||||
end.
|
39
Tests/PS/stringtest.simba
Normal file
39
Tests/PS/stringtest.simba
Normal file
@ -0,0 +1,39 @@
|
||||
program new;
|
||||
type
|
||||
LetsDoThis = record
|
||||
str : string;
|
||||
x,y : integer;
|
||||
end;
|
||||
LetsDoThis2 = record
|
||||
str : string;
|
||||
pt : TPoint;
|
||||
end;
|
||||
Yeah = array of LetsDoThis2;
|
||||
ArrThis = array of yeah;
|
||||
|
||||
|
||||
var
|
||||
x : LetsDoThis;
|
||||
y : arrthis;
|
||||
j : TForm;
|
||||
i,ii : integer;
|
||||
begin
|
||||
x.str := 'Testmebitch';
|
||||
x.x := 500;
|
||||
x.y := -900;
|
||||
Writeln(x);
|
||||
SetLength(y,2);
|
||||
for i := 0 to high(y) do
|
||||
begin;
|
||||
setlength(y[i],2);
|
||||
for ii := 0 to high(y[i]) do
|
||||
begin;
|
||||
y[i][ii].pt := Point(i*5,-random(9000));
|
||||
y[i][ii].str := format('[%d][%d]=%s',[i,ii,tostr(y[i][ii].pt)]);
|
||||
end;
|
||||
end;
|
||||
Writeln(y);
|
||||
Writeln(TPointArray([Point(5,5),Point(20,1337),point(1,2)]));
|
||||
J := TForm.Create(nil);
|
||||
Writeln(j.canvas);
|
||||
end.
|
Loading…
Reference in New Issue
Block a user