SRL Archive - First Scripts

[SRL4] Krimityper


Krim0407

2008-05-20 15:05:32

Krimityper

Current version: 1.02
Coded for Scar 3.15 #16

This autotyper is my first script that's written from scratch. Hoping for some sugestions and proggies. Its really basic, but I want to make it advanced in some times.

Features:
  • Talkes as many times you set it for
  • Anti-Ban (Random colours and waiting)
  • Pretty good and accurate progressreport

Improvements for next version
  • Add for how long script will run (something like: until(timerunning >= timetorun).)
  • SRL-STATS
  • Trade accepter
  • Feel free to give me sugestions!!

Version history
Ver 1.02
RELEASED - Script uploaded and some final adjustments done

Ver 1.01
Still private - Fixed some bugs and improved the script.


Ver 1.00
First private writing. The core of the script was written.


{-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-)
| __ ___ |
| | | / / _ _ _ |
| | | / / |_| |_| | | |
| | |/ / _ ___ _ _ __ ___ _ _| |_ __ __ ___ _____ _ ___ |
| | / | |/ ___\| || |/__ \/ __ \ | ||_ _|| | | || \ / __ \ | |/___\ |
| | |\ \ | / | || / \ / \ || | | | \ \ / / | |\ \| |____|| / |
| | | \ \ | | | || | | | | || | | |_ \ \/ / | |/ /| |___/|| | |
| |__| \__\|_| |_||_| |_| |_||_| \__/ \ / | _/ \______/|_| |
| / / | | |
| /__/ |_| |
| |
| Krimtyper V1.02 |
| Coded for Scar 3.15 #16 |
| |
| Instructions: |
| 1. Get your char to where you want to talk |
| 2. Setup the script on line 41-45 |
| 3. Log in to your account |
| 4. Drag the crosschair to runescape |
| 5. Press play and watch the signature, then enjoy the autotypes |
| |
| |
(-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-}

Krim0407

2008-05-21 10:45:28

2 views and no comments, common, give me a proggie or something. I want to know how it works.

P1nky

2008-05-21 13:08:34

krim calm down… and those 2 views are from you dont double post.
and im at school cant look atm. btw not many ppl use autotypers. ppl can see how the coding is tho ill check soon :P

Sparkii

2008-05-22 22:07:31

Lol i tried this and it works pretty good. Just, i forgot to change the 'Changeme' and everyone was like wtf? lol Good job for your first script

Hatched.Egg

2008-05-23 05:58:37

Nice script for a first script, try to add a trade accepter just for the sake of it :P

~ Hatched.Egg

iky789

2008-05-23 06:06:45

nice not bad for first script:)

Krim0407

2008-05-23 08:09:48

Thank you for your feedback. Im glad it worked. Anyone got a proggie for me? (Lol, proggie on a autotyper, made it for fun)

From: Hatched.Egg
Nice script for a first script, try to add a trade accepter just for the sake of it :P

~ Hatched.Egg


I will see what I can do!

From: iky789
nice not bad for first script:)


You should look at script before commenting. Only 2 more views, and the other ones gave a description on how it worked. SPAM REPORTED

Ashur2Good

2008-05-23 08:11:31

krim, i feel in a helping mood today (h) I'll look through the script now and edit this post later :)

-Ashur

Krim0407

2008-05-23 08:20:06

Thank you. I just want to ask you a question? How to you make it stop after a amount of time that I set in const? Please look at my script what I did try.

Ashur2Good

2008-05-23 08:40:14

Alright, these are the following things i did to your script (Please don't kill me! :eek: )

First off, no anti randoms! :confused:

Added these for anti randoms:


/////////////////////////////Randoms////////////////////////////////////////////
Procedure FindNormalRandomz; //Made my another random procedure, for in Fight. Cheers Frozen :)
Begin if InFight then //If the character is in a fight it will do the following:
Begin
Mouse(MMCX - 50, MMCY, 0, 0, true); //Move the ouse and click on the vars specified
Wait(8000 + random(4000)); //Wait 8000 Ms plus a random 4000
Mouse(MMCX + 50, MMCY, 0, 0, true); //Move the ouse and click on the vars specified
FFlag(0); //Wait for the flag on the minimap to disapear
end;
Exit; //Exits the procedure
if FindMod then //If it finds a mod, then it will do the following :
SelectWorld(106); //Selects the world "106"
if FindNormalRandoms then //If it finds the normal randoms it will do the following:
Wait(RandomRange(250, 1000)); //Wait the random range specified
end;
/////////////////////////////Randoms////////////////////////////////////////////


/////////////////////////////AntiRandoms////////////////////////////////////////
procedure DoAntiRandoms; // Puts all the anti random checks into one procedure.
begin
FindNormalRandomz; //One of the anti randoms procedure
FindNormalRandoms; //Another one
ClickToContinue; //...
end;
/////////////////////////////AntiRandoms////////////////////////////////////////


Then, in your main loop i added:

DoAntiRandoms;

Now thats the randoms sorted :)

And then, why add random cases? Maybe some people would like to choose what kind of message they want? :bart:

So for the cases change this :

procedure DoDaTalking;
begin
if RandomType = True then
begin
case Random(9) of
0: TypeSend('Flash2:Wave2: '+WhatToType);
1: TypeSend('Glow1:Shake: '+WhatToType);
2: TypeSend('White:Scroll: '+WhatToType);
3: TypeSend('White:Slide: '+WhatToType);
4,5: TypeSend('White: '+WhatToType);
6: TypeSend('Glow2: '+WhatToType);
7: TypeSend('Glow3: '+WhatToType);
8: TypeSend('Scroll: '+WhatToType);
end;
end;
if RandomType = False then
begin
If UseColours = True then
begin
case textsend of
'Flash': TypeSend('Flash2:Wave2: '+WhatToType);
'Glow1': TypeSend('Glow1:Shake: '+WhatToType);
'WhiteScroll': TypeSend('White:Scroll: '+WhatToType);
'WhiteSlide': TypeSend('White:Slide: '+WhatToType);
'White': TypeSend('White: '+WhatToType);
'Glow2': TypeSend('Glow2: '+WhatToType);
'Glow3': TypeSend('Glow3: '+WhatToType);
'Scroll': TypeSend('Scroll: '+WhatToType);
end;
end;
If not UseColours = True then
begin
TypeSend(WhatToType);
end;
end;
end;

Then, you have to add these in your declared const's:

textsend             = 'Flash';     //Do you want the script to use different colours when typing?
UseColours = True; // Already have this there o.o
RandomType = False; // Use random special effects?

So for the textsend variable, it's easier for the user to choose the effect :) And they can still choose the random type if they want too :D


Another thing was, you had a lot of loops in the wrong places. Why not just have 1 in your main loop?

  repeat
...
until(TotaledTyped = HowManyToType); //Checks to see if it's typed as much as the user wanted


Get what i mean? It's just easier that way :)

Well, you asked if you could tell how long its going for and stop. Why not just make it stop when it's done enough messages, not time :)

So you add the top loop you add this as well:

TotaledTyped:= TotaledTyped + 1;

After the end of each loop, so like this :

  repeat
DoDaTalking;
WaitingTimeAndRandomness;
//CountingDaTypes;
DoAntiRandoms;
ProgressReport;
TotaledTyped:= TotaledTyped + 1;
until(TotaledTyped = HowManyToType); //Need some help here.

Better to do it like that, trust me :spongebob:


But that's not it, in your const's you gotta add this :

HowManyToType             = 199999;   //How many times to type the text


Now you have a better working script :)


Sorry if i took a while to respond :redface:


Hope that helped

P.S: I attached the script

-Ashur

Krim0407

2008-05-23 09:02:27

I just want to say WOW.
Thank you for the help, will look through.

EDIT: What include do you use for the FindNormalRandomz? Found 'InFight', but can't find 'SelectWorld'(btw, whats the point of switching worlds?)

Ashur2Good

2008-05-23 10:45:28

From: Krim0407
I just want to say WOW.
Thank you for the help, will look through.

EDIT: What include do you use for the FindNormalRandomz? Found 'InFight', but can't find 'SelectWorld'(btw, whats the point of switching worlds?)



Woops sorry, add this at the top with the rest of the other includes

{.include SRL/SRL/misc/WorldSwitcher.scar}

And there are many reasons to switch worlds, one being if it's too crowded


-Ashur

Krim0407

2008-05-23 11:15:40

Ok, now it compiles. But when I start the script it says:
[Runtime Error] : Out Of Range in line 1211 in script C:\Programfiler\SCAR 3.15\includes\SRL/SRL/Core/AntiRandoms/AntiRandoms.scar

{*******************************************************************************
function FindTalk: Boolean;
by: MastaRaymond and little bit of help from Wizzup?
Description: Searches screen for NickName and handles ALL Talking Randoms.
*******************************************************************************}

Function FindTalk: Boolean;
var
......
begin;
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(1);
FindColorsTolerance(TPA, 65535, 3, 3, 515, 336, 0);
if FindTPAinTPA(Players[CurrentPlayer].NickTPA,TPA,Matches) then //This is line 1211 in AntiRandoms.scar
For I := 0 to High(Matches) do
begin;
FindColorsTolerance(TPA,65535,3, Matches[I].y - 1,516,Matches[I].y + 14,0);
....

Whats wrong? Never seen that error before… :( :rolleyes:

Ashur2Good

2008-05-23 11:45:01

From: Krim0407
Ok, now it compiles. But when I start the script it says:
[Runtime Error] : Out Of Range in line 1211 in script C:\Programfiler\SCAR 3.15\includes\SRL/SRL/Core/AntiRandoms/AntiRandoms.scar

{*******************************************************************************
function FindTalk: Boolean;
by: MastaRaymond and little bit of help from Wizzup?
Description: Searches screen for NickName and handles ALL Talking Randoms.
*******************************************************************************}

Function FindTalk: Boolean;
var
{$Define SMART}
//Defines SMART for use
{.include SRL/SRL/misc/Smart.scar}
//Includes Smart......
begin;
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(1);
FindColorsTolerance(TPA, 65535, 3, 3, 515, 336, 0);
if FindTPAinTPA(Players[CurrentPlayer].NickTPA,TPA,Matches) then //This is line 1211 in AntiRandoms.scar
For I := 0 to High(Matches) do
begin;
FindColorsTolerance(TPA,65535,3, Matches[I].y - 1,516,Matches[I].y + 14,0);
....

Whats wrong? Never seen that error before… :( :rolleyes:




Well of course :redface: What a silly error, how is it going to find the randoms if you don't have decalare players? lol :p

So now, we gotta add log in info and all :)

Here we go. First off, let's add the main bit:


///////////////////////////DeclaringPlayers/////////////////////////////////////
procedure DeclarePlayers;
begin
HowManyPlayers := 1; //Number of players
NumberOfPlayers(HowManyPlayers);
CurrentPlayer:= 0;

Players[0].Name :='';//Name Goes Here
Players[0].Pass :='';//PassWord Goes Here
Players[0].Nick :='';//3-4 LowerCase Letters Of Your Name
Players[0].Active:=True;//True If Using, False If Not
Players[0].Integers[0] := 100; // How many messages to type
Players[0].Integers[1] := 1000; // How long to wait before typing each message (Around 750 is recommended) How often to repeat the messages in milliseconds (500 = 0,5 sec, 1000 = 1 sec, 2500 = 2,5 sec etc.)
Players[0].Strings[0] := 'Wow, complete ownage?'; // What to type here
Players[0].Strings[1] := 'Flash'; // What special effect?
Players[0].Booleans[0] := True; // Using Colors? True or False
Players[0].Booleans[1] := False; // Random Effects?

End;
///////////////////////////DeclaringPlayers/////////////////////////////////////

Then in your main loop, after SetUpSRL; add this :

DeclarePlayers; //Declares the player, to use in the next procedure
LogInPlayer; // Logs in the next avalaible player from "DeclarePlayers"

That should log in the players :)

See all the Booleans and strings and integers under the login info?
Thats used so you can put diffrent constants for EACH player. Pretty handy :bart:

Next thing i added was SMART, just add this before
{.include SRL/SRL.scar} :

{$Define SMART}
//Defines SMART for use
{.include SRL/SRL/misc/Smart.scar}
//Includes Smart

In your main loop, Before SetUpSRL; Put this :


SmartSetupEx(108, False, true); // Smarts loading procedure
while not(SmartReady) do // if SMART isn't ready, it will do the following:
Wait(1000); //Wait 1 second (1000 Miliseconds)
SetTargetDC(SmartGetDC); //Sets SMART's target
if not(LoggedIn) then //Fail safe if it isn't logged in.
while not(SmartGetColor(386, 249) = 65535) do // Until Smart loads, it will do the following:
Wait(1000); //Wait


Now you have SMART :)


Then, i removed the const's and put these instead for all the const's :

Players[CurrentPlayer].VARIABLE[NUMBER]

An example of that would be :

Players[CurrentPlayer].Strings[1]

See how much more flexible it is? ^^

Also changed a few other minor things, well anyways. :redface:


Attached the script :)

-Ashur

Krim0407

2008-05-24 07:16:09

Thank for the help.

As this is a half automatic script, I dont think it need SMART, maybe later when its fully automated. My next step is to make it accept trades (Click on the pink text if someone wants to trade.)

Next version will be released soon. When it is finished, it will be a fully automatic merchanter, and just a autotalker in separate versions.

EDIT:
  
var
x, y, colorsign: Integer;
TotaledTyped, hp, hptime: Integer;

What are all those variables for? They aren't even used in script.

It won't log in, im not sure why, but it says ut has typed a message, then succesfully executed. Something must be wrong, but I cant figure it out. I attached the script if someone could look at it and help me. Again the problem is, it is not logging in any player. And YES player is set active, it just starts typing. THIS DOES NOT WORK, ONLY FOR PEOPLE THAT IS IN WANT OF HELPING ME.

Krim0407

2008-05-26 09:46:30

BUMP - Anyone? Can anyone please help me with this problem? ^

akad_ad

2008-06-02 08:32:49

Thanks. this was veary great:)

_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
Krims Autotyper Version 1,02
——————————————————————————————-
Talked for: 1 Hours, 2 Minutes and 44 Seconds
Typed your message: 1041 times
POST UP ATLEAST ONE PROGGY AND A MESSAGE OF HOW GOOD IT WORKED SO I MAY IMPROVE THIS
_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-

Krim0407

2008-06-02 08:57:39

From: akad_ad
Thanks. this was veary great:)

_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
Krims Autotyper Version 1,02
——————————————————————————————-
Talked for: 1 Hours, 2 Minutes and 44 Seconds
Typed your message: 1041 times
POST UP ATLEAST ONE PROGGY AND A MESSAGE OF HOW GOOD IT WORKED SO I MAY IMPROVE THIS
_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
Flash2:Wa


TY, first proggy, would love to see more. Also Ashur, would you please answer my question?