SRL Archive - Research & Development Lounge

NSPlugin.dll ~ Over 13 functions + Includes ALL NEW CodeType!


Nadeem

2009-07-19 07:42:09

Hello people of SRL :)

I have finally finished some of my functions including the all new CodeType!

I will explain each function upon request but for now I'll explain what CodeType Does.

CodeType:

CodeType('<wait:$w>$n<space/><shift>$n</shift>$n', [500, 'Nadeem', 'sy', 'ed']);

{
Output = (wait 500ms)Nadeem[space]SYed
}

Valid Code Queries:

Codes : array [0..8] of string =
('<shift>', '</shift>', '<ctrl>', '</ctrl>',
'<alt>', '</alt>', '<space/>', '<wait:$w>', '$n');

As you see, it basically reads your query and outputs it in a friendly manner :)

To use CodeType(); You must have the CodeType function code, included or in your script, and also have the NSPlugin.dll file in your Plugins folder.

NSPlugin.dll

Quick Functions List:

function ReadlnEx(S: string; var Response: string; var Checked: TBooleanArray; uButton, uCheckB: TStringArray; FormType: Integer): Integer;
function RandomChar: Char;
function CompareStr(S1, S2: string; CaseSensitive: Boolean): Integer;
procedure Sort2DIntArr(var Data: T2DIntArray; Pos: Integer);
procedure SortStrArr(var Data: TStringArray);
function IntArrToStr(TIA: TIntegerArray; Delimiter: string): string;
function IntArrIn2DIntArr(TIA: TIntegerArray; T2DIA: T2DIntArray): Boolean;
procedure CodeTypeData(Query: string; var T2DIA: T2DIntArray);
function BeepSound(Frequency, Duration: Cardinal): LongBool;

//Removed FloatToIntEx, CharOfString, SwapInt, SwapStr, StrPattern cuz there's no point

In-Depth Funtions List

function ReadlnEx(S: string; var Response: string; var Checked: TBooleanArray; uButton, uCheckB: TStringArray; FormType: Integer): Integer;
//
// - Example -
// var
// R: string;
// B: TBooleanArray;
//
// ReadlnEx('Please Agree To My Terms And Conditions', R, B,
// ['Continue'], ['I Agree', 'I Disagree'], Nothing);
//

function RandomChar: Char;
//
// Returns a random uppercase character
//

function CompareStr(S1, S2: string; CaseSensitive: Boolean): Integer;
//
// S1 < S2 = -1
// S1 = S2 = 0
// S1 > S2 = +1
//

procedure Sort2DIntArr(var Data: T2DIntArray; Pos: Integer);
//
// Data = [TIntegerArray([3, 6]), TIntegerArray([2, 1]), TIntegerArray([1, 9])]
// Pos = Position of the IntegerArray you want to sort by.
// - Example -
// Pos = 0
// Data = [1, 9] [2, 1] [3, 6]
// Pos = 1
// Data = [2, 1] [3, 6] [1, 9]
//

procedure SortStrArr(var Data: TStringArray);
//
// - Example -
// Data = ['Works', 'Gratz', 'It']
// --
// Data = ['Gratz', 'It', 'Works']
//

function IntArrToStr(TIA: TIntegerArray; Delimiter: string): string;
//
// Converts an array of Integers to String
//

function IntArrIn2DIntArr(TIA: TIntegerArray; T2DIA: T2DIntArray): Boolean;
//
// Checks to see if the defined Array Of Integers is somewhere in the
// 2 Dimensional Integer Array
//

procedure CodeTypeData(Query: string; var T2DIA: T2DIntArray);
//
// It is used in my CodeType, no need for you anyway :)
//

function BeepSound(Frequency, Duration: Cardinal): LongBool;
//
// Will make a beeb sound :)
// Might only work on desktop computers
//

The RAR file contains all the source files and the DLL file. All you have to do is move the DLL file to Plugins folder and start SCAR.

I Also Have The SVN At: http://nsplugin-dll.googlecode.com/svn/trunk/




~NS

senrath

2009-07-19 07:47:39

Pretty cool. My only question is whats the point of CharOfString? Strings area already treated as arrays of characters in SCAR, so if I wanted, say, the third character in a string, I could just do this:

TheString[3]

Nadeem

2009-07-19 07:49:50

From: senrath
Pretty cool. My only question is whats the point of CharOfString? Strings area already treated as arrays of characters in SCAR, so if I wanted, say, the third character in a string, I could just do this:

TheString[3]


Thanks! I started on this last week, and was unaware that SCAR let us do that :p Oh well!



~NS

Quickmarch

2009-07-19 11:28:52

No need for SwapInt and SwapStr, the in-built Swap takes anything.

marpis

2009-07-19 13:41:18

lol tune your guitar with scar:
BeepSound(440, 60*1000);
:p

Nadeem

2009-07-19 18:43:38

From: Quickmarch
No need for SwapInt and SwapStr, the in-built Swap takes anything.

I had created them to use inside some of my other functions in there, so what the hell.

From: marpis
lol tune your guitar with scar:
BeepSound(440, 60*1000);
:p

lol, does that actually work..?



~NS

marpis

2009-07-19 18:53:36

From: Nadeem
I had created them to use inside some of my other functions in there, so what the hell.


lol, does that actually work..?



~NS


well if the frequency in your function is correct then 440 is middle A

P1nky

2009-07-20 01:39:32

From: marpis
lol tune your guitar with scar:
BeepSound(440, 60*1000);
:p


good job Nadeem bhai, lol yea woo tuner :P hey not a bad idea :P hmm

Nadeem

2009-07-20 03:03:18

From: ~~Joker~~
good job Nadeem bhai, lol yea woo tuner :P hey not a bad idea :P hmm


Hey thank you :D

I just tested it on my desktop and yes, it can be made to make funny sounds :P

I did something like:

var I: Integer;
begin
for I := 0 to 90 do
BeepSound(I * 100, 50);
end.



~NS

Freddy1990

2009-07-20 16:17:26

What's the point of SwapInt/SwapString? SCAR has a Swap method that works for all types…

And… StrPattern? SCAR has Regex functions?

… FloatToIntEx? SCAR has Trunc, Round, Ceil and Floor…

BeepSound is a bit pointless as well, seeing it'll only work on a pc with a built-in monophonic speaker which a lot of PC's don't have, especially laptops and many home-built and modern desktops…

Smartzkid

2009-07-20 16:38:09

Cool plugin and nice work, but I don't quite see the point, either.

Repped for effort, though :)

Nadeem

2009-07-20 22:31:52

From: Freddy1990
What's the point of SwapInt/SwapString? SCAR has a Swap method that works for all types…

And… StrPattern? SCAR has Regex functions?

… FloatToIntEx? SCAR has Trunc, Round, Ceil and Floor…

BeepSound is a bit pointless as well, seeing it'll only work on a pc with a built-in monophonic speaker which a lot of PC's don't have, especially laptops and many home-built and modern desktops…

I explained already in my earlier post why i have swap funcs. StrPattern is not a regex function, its something a search engine would use to find matching strings. BeepSound only for fun :p

From: Smartzkid
Cool plugin and nice work, but I don't quite see the point, either.

Repped for effort, though :)

lol thanks! This was a just for fun plugin basically, I was just trying to learn new things outside of just the world of runescape macroing



~NS

Freddy1990

2009-07-21 01:49:55

I know StrPattern isn't a regex function, but the Regex functions in SCAR allow you to do the same thing and way way more, so I don't rly see the point…

Nonetheless, good job.

Nadeem

2009-07-21 06:16:56

From: Freddy1990
I know StrPattern isn't a regex function, but the Regex functions in SCAR allow you to do the same thing and way way more, so I don't rly see the point…

Nonetheless, good job.


Yes that I agree :p - Thanks!



~NS