PDA

View Full Version : IP-Includes Package



Daniel
01-08-2008, 01:37 AM
IP-Includes
Created By IP-Drowner

UPDATE TRACKER:
-* Added EasyProgress

What this include Includes:
Modified Version of Functions/Procedures:
-* TypeSentence
- Modified version of TypeSend, now types CAPITAL LETTERS.
-* SendLetter
- Modified version of TypeByte, makes typing in between keys more human-like.


New Functions/Procedures:
-* SendMouse
- Will move the mouse human-like to x, y.
-* SendClick
- Will click the mouse where it is human-like.
-* FindClient
- Will find a part of the title and will switch to that window.
-* RandomTalk
- Will type 3 sentences randomly - Uses TypeSentence.
-* EasyProgress
- Will send a small progress report into the debug box.
-* GetColorAt
- Will find a colour at x, y. Returns True if it has found the colour.

This package includes a main loop (But is commented out) which tests all functions. You can run it if you want but coordinates for the URL bar may be different for different users (as it find's the URL bar and either types in http://srl-forums.com/forum/, http://sp0rk-eh.com/ or http://freddy1990.com).

Well, enjoy! And please, no criticism :( But post feedback :)

Include Package can be downloaded at the bottom of this post.

P1nky
01-08-2008, 05:00 AM
wow really nice!

ill have to use these

Daniel
01-08-2008, 05:49 AM
wow really nice!

ill have to use these

Wow, thank ;)

I just hope one of these are included into SRL. If it ain't i just never stop trying :p

Well, at least one good piece of feedback from an SRL Member is a sign of good luck :)

Dumpin
01-08-2008, 08:26 AM
What is the differens between sendmouse and mouse?

ZaSz
01-08-2008, 08:32 AM
Wow dude nice! I might just use some of these for use.

Daniel
01-08-2008, 08:38 AM
Wow dude nice! I might just use some of these for use.
Lol, Wow dude thanks :p

@Dumpin
This adds a little jump at the end when the coordinates are reached.

Added updated version. Now includes EasyProgress, creates a simple progress report for the user. Saves time writing up your own, yet small but handy.

R0b0t1
01-08-2008, 11:56 PM
Shweet.

I'll look at the code and may post more...

Daniel
01-09-2008, 12:32 AM
Shweet.

I'll look at the code and may post more...

Wow! Thanks :)

For the EasyProgress procedure, i was thinking it would send a small progress report into the debug box and when the player logs out it sends the main progress report created by the user.

P1nky
01-09-2008, 02:37 AM
you should apply for members i seen some scripts from you lately...(mouse locker and this ) really nice

Daniel
01-09-2008, 03:14 AM
you should apply for members i seen some scripts from you lately...(mouse locker and this ) really nice
Yeah but i need a Runescape Script, and i need to know how to use RadialWalk and using DDTMs - arghhh!

Dumpin
01-09-2008, 08:29 AM
if you looked at the code of mouselocker it looked pretty easy though... just an false loop to 1 direction untill you press a button
it should needed more failsafes because when you F3 button is like not working while you got a important not safed program open you are screwed :D

Daniel
01-09-2008, 10:02 AM
if you looked at the code of mouselocker it looked pretty easy though... just an false loop to 1 direction untill you press a button
it should needed more failsafes because when you F3 button is like not working while you got a important not safed program open you are screwed :D
It is easy, i know. It just uses MoveMouse and ClickMouse and a basic form style setting.

But please explain further to what you mean by adding more fail safes? It really only needs an Function Key to be put down. Hmm, maybe i should allow the user to input a Function Key that they would like to use.

Dumpin
01-09-2008, 03:09 PM
maybe if the click the mouse 3 times while it is on the middle coords?

mickaliscious
01-09-2008, 09:48 PM
Thought I'd snazzify a few funcs/procs for you. You're probably sick of me doing this but here it goes:

procedure TypeSentence(Sentence: String);
(*****Created by Mutant Squirrle - Modified by IP-Drowner*****)
(*****Added Caps Lock Keys - You can now type CAPITAL LETTERS*****)
var
p,i: byte;
ShiftKey: Boolean;
Caps: TStringArray;
begin
Caps := ['~','!','@','#','$','%','^','&','*','(',')','_','+','A','B','C','D','E','F',
'G','H','I','J','K','L','M','N','O','P','Q','R','S ','T','U','V','W','X','Y',
'Z','<','>','?',':','"','{','}','|']
for p := 0 to Length(Sentence) do
begin
for i := 0 to 46 do
begin
ShiftKey := (Sentence[p] = Caps[i]);
if ShiftKey then Break;
end;
if ShiftKey then
begin
KeyDown(VK_Shift);
Wait(10+random(13));
SendLetter(GetKeyCode(Sentence[p]));
KeyUp(VK_Shift);
end else SendLetter(GetKeyCode(Sentence[p]));
Wait(25+Random(50));
end;
SendLetter(13);
end;

procedure SendMouse(x,y,rx,ry: Integer);
(*****Created By IP-Drowner*****)
(*****Moves the mouse to a specified location*****)
begin
MoveMouseSpline(x,y,rx,ry);
MoveMouseSpline(x+1+Random(10),y+1+Random(10),rx+1 +Random(8),ry+1+Random(8));
end;

function FindClient(Name: String): Boolean;
(*****Created By IP-Drowner*****)
(*****Will find a part of the specified window name. If found will return true
and will switch windows - CaSe SenSItIve*****)
begin
Result := FindWindowTitlePart(Name, True)
if Result then ActivateClient;
end;

function GetColorAt(x, y, colour: Integer): Boolean;
(*****Created By IP-Drowner*****)
(*****Will Find Specified Colour At Specified Coordinates*****)
begin
Result := (GetColor(x,y) = colour);
end;


Also, your SendLetter is basically the same as TypeByte. Theres really no point in having it in there.

RandomTalk could really be more usefull and take advantage of SRL's pre-existing functions. Maybe expand it to use any number of strings:

procedure RandomTalk(Choices: TStringArray;);
begin
TypeSentence(HumanText(Choices[RandomRange(0,High(Choices))], 50));
end;


...Now they might have a chance of getting into SRL but I doubt it.

Daniel
01-10-2008, 12:25 AM
Thought I'd snazzify a few funcs/procs for you. You're probably sick of me doing this but here it goes:

procedure TypeSentence(Sentence: String);
(*****Created by Mutant Squirrle - Modified by IP-Drowner*****)
(*****Added Caps Lock Keys - You can now type CAPITAL LETTERS*****)
var
p,i: byte;
ShiftKey: Boolean;
Caps: TStringArray;
begin
Caps := ['~','!','@','#','$','%','^','&','*','(',')','_','+','A','B','C','D','E','F',
'G','H','I','J','K','L','M','N','O','P','Q','R','S ','T','U','V','W','X','Y',
'Z','<','>','?',':','"','{','}','|']
for p := 0 to Length(Sentence) do
begin
for i := 0 to 46 do
begin
ShiftKey := (Sentence[p] = Caps[i]);
if ShiftKey then Break;
end;
if ShiftKey then
begin
KeyDown(VK_Shift);
Wait(10+random(13));
SendLetter(GetKeyCode(Sentence[p]));
KeyUp(VK_Shift);
end else SendLetter(GetKeyCode(Sentence[p]));
Wait(25+Random(50));
end;
SendLetter(13);
end;

procedure SendMouse(x,y,rx,ry: Integer);
(*****Created By IP-Drowner*****)
(*****Moves the mouse to a specified location*****)
begin
MoveMouseSpline(x,y,rx,ry);
MoveMouseSpline(x+1+Random(10),y+1+Random(10),rx+1 +Random(8),ry+1+Random(8));
end;

function FindClient(Name: String): Boolean;
(*****Created By IP-Drowner*****)
(*****Will find a part of the specified window name. If found will return true
and will switch windows - CaSe SenSItIve*****)
begin
Result := FindWindowTitlePart(Name, True)
if Result then ActivateClient;
end;

function GetColorAt(x, y, colour: Integer): Boolean;
(*****Created By IP-Drowner*****)
(*****Will Find Specified Colour At Specified Coordinates*****)
begin
Result := (GetColor(x,y) = colour);
end;


Also, your SendLetter is basically the same as TypeByte. Theres really no point in having it in there.

RandomTalk could really be more usefull and take advantage of SRL's pre-existing functions. Maybe expand it to use any number of strings:

procedure RandomTalk(Choices: TStringArray;);
begin
TypeSentence(HumanText(Choices[RandomRange(0,High(Choices))], 50));
end;


...Now they might have a chance of getting into SRL but I doubt it.
Lol, thanks :) And i don't care about being pwnd to make the script its shortest.

The SendLetter is practically the same but it the waits inside of it are more human-like.

Never knew TStringArray even existed, thanks :) And i have no idea how the hell you put that together :p

I wanted the result in GetColorAt to be either True or False. Not sure if that would do the job though.

Yeah, i am not as good as you and i do not know how to shorten up the scripts to its minimum (Does shortening up the procedures/functions when applying to SRL Members necessary?). But thanks again :)

mickaliscious
01-10-2008, 02:27 AM
Its fine I do this stuff half out of fun and the other half to teach others.

The default result of a function is False, so if you never say Result := True then it will result as false, there is no need to say Result := False;

Instead of saying "if (Boolean-Function) then Result := True;" you can do "Result := (Boolean-Function);" -Saves some time/memory.
* (integer = integer) can be used as a boolean (= can be >,<, etc.) and will result true if they are equal. Same can be done for strings: "Result := (String1 <> String2);"

Thats really all there is, not using un-needed begins/ends/ors/ands is the only thing left that I do to maximize code.

I'm not a master or anything I'm just good at shortening stuff. I picked half of it up by just looking at the SRL includes and seeing what they do.

If you are very efficient in your work you are more likely to get members, because it shows you have a good knowledge of the language and people generally like scripts that have the most 'bang for their buck'. The number of lines doesn't matter, its what you do in those lines.

Keep up the good work though. Hehe, a good new goal would be to try and make everything Mickey-proof.


Edit for the randomtalk, an example of how to use it would be:

if InChatMulti('hello','hi','sup') then
RandomTalk(['hey','ello','wazup','...']);

You can enter an unlimited amount of responses that will be chose randomly. TArrays are fun. HumanText makes the responce human like with a 1/30 chance "HumanText('string',30);" The RandomRange(0,High(Choices)) gets a random number between 0 and the highest number of the TStringArray. And the Chocies[# generated] gets the string to send with TypeSentence. (Ex. Choices[0] would be 'hey')

Hope that helps? lol

R0b0t1
01-10-2008, 11:17 PM
Hmm... Well, its nice that you've learned what most of the code does now, so I would definitely vote yes on your members application.

Learning DDTM's isn't that hard actually, neither is Radial Walking, as there is a tool to show you which part it will search. And, actually, Radians (http://en.wikibooks.org/wiki/Trigonometry/Radian_and_degree_measures). Useful information. (Since you most likely have a knowledge of degrees...)

Daniel
01-11-2008, 07:11 AM
Hmm... Well, its nice that you've learned what most of the code does now, so I would definitely vote yes on your members application.

Learning DDTM's isn't that hard actually, neither is Radial Walking, as there is a tool to show you which part it will search. And, actually, Radians (http://en.wikibooks.org/wiki/Trigonometry/Radian_and_degree_measures). Useful information. (Since you most likely have a knowledge of degrees...)

Thanks if you vote yes, but MasterKill and that will vote a bid NO.

Also, i am in Grade 8 and i have no idea what pie is :'(

I do know DTM (Deformable Template Model) but i don't how to use DDTMs (Dynamic Deformable Template Model). I can understand the grasp of radial walking but all the tutorials don't explain to well.

Ok, thanks r0b0t1 :)

Da 0wner
02-09-2008, 06:07 AM
if you run this script just included function from ipincludes.


Program New;
{.include SRL/SRL.scar}

procedure SendMouse(x,y,rx,ry: Integer);
(*****Created By IP-Drowner*****)
(*****Moves the mouse to a specified location*****)
begin
MoveMouseSpline(x,y,rx,ry);
MoveMouseSpline(x+1+Random(10),y+1+Random(10),rx+1 +Random(8),ry+1+Random(8));
end;

Begin
SendMouse(50,50,0,0);
end.


If you movethe mouse like shaking it a little then it just moves the mouse hecha fast there