PDA

View Full Version : [Magic] Simple alcher



slackeru
07-10-2010, 11:57 PM
Requesting a simple alcher that will alch my god damn yew longbows. So sick of sitting and just clicking.

Highly appreciated :D

i luffs yeww
07-11-2010, 05:28 AM
http://villavu.com/forum/showthread.php?t=57545

slackeru
07-11-2010, 10:17 AM
http://villavu.com/forum/showthread.php?t=57545

That doesn't work. I'm sorry.

i luffs yeww
07-11-2010, 06:55 PM
:p Why are you saying sorry to me? Not my script.

Hmm.. There seems to be a problem with Cast().

Made a few changes. Check the other thread. ;) Works fine for me now.

Narcle
07-12-2010, 02:56 PM
That doesn't work. I'm sorry.

Cast() doesn't work for members. Checked it myself. Need to update it at some point = / There are 12 more spells for members.

slackeru
08-03-2010, 12:23 PM
Cast() doesn't work for members. Checked it myself. Need to update it at some point = / There are 12 more spells for members.

So it's a SRL error?

marksteele
08-03-2010, 03:38 PM
this works fine for me (this is my edited version you can get the origonal at http://villavu.com/forum/showthread.php?t=54888)

(only tested in simba)

{================================================= =============================]
[ Instructions ]
[================================================== ============================]
[ ]
[ 1. Equip fire staff. ]
[ 2. Place item to alch in noted form in the 3rd inventory slot. ]
[ 3. Hide combat, teleport and skill spells. (VERY IMPORTANT) ]
[ 4. Turn off all chat but game. ]
[ 5. Make sure you have enough nature runes in your inventory. ]
[ 6. Post any progress reports and/or bugs! ]
[ 7. Determine whether or not you're using SMART (line 16). ]
[ Created by pyroryan. Major credit to Coh3n for letting me use his script ]
[ as a base. ]
[ ]
[================================================== ============================}

program AutoAlch;
{.Include srl\srl\Misc\Smart.scar}
{.Include srl\srl.scar}
{.Include srl\srl\Misc\Debug.scar}

const
// Integers.
TAlchs = 0;
Alchs = 1;
LEVELS = 2;
EXP = 3;
BREAKS = 4;
ANTIBAN = 5;
RANDOMSEARCH = 6;
RANDOMEVENT = 7;
// Booleans.
TAKE_BREAKS = 0;

// Strings.
LAMP_SKILL = 0;

{ const Mouse Constants;
Description: Constants representing different types mouse clicks. }
const
MOUSE_OPTIONS = 3;
CLICK_LEFT = 1;
CLICK_RIGHT = 2;
HOVER = 3;

{ var Global;
Description: Global variables used throughout the script. }
var
startLevel: Integer;

{================================================= =============================]
[ Setup the script from here to line 77! ]
[================================================== ============================}

const
SmartWorld = 66; // Which World/Server do you want to use?
SmartMembers = True; // Is it a Members World?
SmartSigned = True; // Signed/UnSigned Client?
SmartSuperDetail = False; // Use Super Detail?

const
RANDOM_SOUND = False; // True = a sound when a random is found.
BREAK_TIME = 6; // How long to break for (in minutes).
// Script will +/- a random 5 minutes.

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

with Players[0] do
begin
Name := '';
Pass := '';
Nick := ''; // 3-4 LOWERCASE letters from your username.
Active := True; // True = use this player.
Integers[TAlchs] := 7000; // Total times to alch.
Booleans[TAKE_BREAKS] := True; // True = the script will take breaks.
Strings[LAMP_SKILL] := 'Magic';
BoxRewards := ['amp', 'mote', 'ostume', 'oins', 'unes', 're', 'ems'];
Integers[LEVELS] := 0; //Do not edit this.


end;
end;

{================================================= =============================]
[ Don't edit below this ]
[================================================== ============================}
procedure Create_Antiban;
begin
case RandomRange(0,4) of

0: begin
WriteLn('Using the BoredHuman anti-ban');
BoredHuman;
with Players[CurrentPlayer] do
Integers[ANTIBAN] := Integers[ANTIBAN] + 1;
end;

1: begin
Writeln('Using the Hover Skill anti-ban');
HoverSkill('random', False);
with Players[CurrentPlayer] do
Integers[ANTIBAN] := Integers[ANTIBAN] + 1;
end;

2: begin
Writeln('Using the random Right Click anti-ban');
RandomRClick;
with Players[CurrentPlayer] do
Integers[ANTIBAN] := Integers[ANTIBAN] + 1;
end;

3: begin
Writeln('Using the examine inventory anti-ban');
ExamineInv;
with Players[CurrentPlayer] do
Integers[ANTIBAN] := Integers[ANTIBAN] + 1;
end;

4: begin
Writeln('Using the Pick Up Mouse anti-ban');
PickUpMouse;
with Players[CurrentPlayer] do
Integers[ANTIBAN] := Integers[ANTIBAN] + 1;
end;

end;
end;

procedure Next_Break;
begin
if (not LoggedIn) then
ExitToLobby;

begin
Writeln('Taking a ' + IntToStr(BREAK_TIME) + ' minute break.');
Logout;
Wait((BREAK_TIME * 60000) + RandomRange(-300000, 300000));
Writeln('Break over, logging back in.');
LoginPlayer;
end;

with Players[CurrentPlayer] do
Integers[BREAKS] := Integers[BREAKS] + 1;
end;

procedure Find_Randoms;
var
soundStr: String;
begin
if (not LoggedIn) then
Exit;

LampSkill := Lowercase(Players[CurrentPlayer].Strings[LAMP_SKILL]);
Writeln('Scanning for random events...');
with Players[CurrentPlayer] do
Integers[RANDOMSEARCH] := Integers[RANDOMSEARCH] + 1;
if (FindNormalRandoms) then
begin
Writeln('Found Random! ' + soundStr);
with Players[CurrentPlayer] do
Integers[RANDOMEVENT] := Integers[RANDOMEVENT] + 1;
end;

UseRewardBox;
FindLamp(LampSkill);
end;

procedure Setup_Report_Loop;
begin
ClearDebug;
Writeln('[================================================== ===============]');
Writeln('[~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Auto Alch Progress ~ ~ ~ ~ ~ ~ ~~ ~ ~ ~ ~]');
Writeln('[================================================== ===============]');

with Players[CurrentPlayer] do
begin
Writeln(PadR('[ Running Time: ' + TimeRunning, 66) + ']');
Writeln(PadR('[ Items Alched: ' + IntToStr(Integers[Alchs]), 66) + ']');
Writeln(PadR('[ Levels Gained: ' + IntToStr(Integers[LEVELS]), 66) + ']');
Writeln(PadR('[ Anti-Bans Performed: ' + IntToStr(Integers[ANTIBAN]), 66) + ']');
Writeln(PadR('[ Random Searches Performed: ' + IntToStr(Integers[RANDOMSEARCH]), 66) + ']');
Writeln(PadR('[ Random Events Found: ' + IntToStr(Integers[RANDOMEVENT]), 66) + ']');
Writeln(PadR('[ Breaks: ' + IntToStr(Integers[BREAKS]), 66) + ']');
end;
Writeln('[================================================== ===============]');
end;

procedure Setup_Report;
begin
ClearDebug;
Writeln('[================================================== ===============]');
Writeln('[~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Auto Alch ~ ~ ~ ~ ~ ~ ~ ~ ~~ ~ ~ ~ ~]');
WriteLn('[~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~Final Report~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ]');
Writeln('[================================================== ===============]');

with Players[CurrentPlayer] do
begin
Writeln(PadR('[ Ran For: ' + TimeRunning, 66) + ']');
Writeln(PadR('[ Items Alched: ' + IntToStr(Integers[Alchs]), 66) + ']');
Writeln(PadR('[ Levels Gained: ' + IntToStr(Integers[LEVELS]), 66) + ']');
Writeln(PadR('[ Anti-Bans Performed: ' + IntToStr(Integers[ANTIBAN]), 66) + ']');
Writeln(PadR('[ Random Searches Performed: ' + IntToStr(Integers[RANDOMSEARCH]), 66) + ']');
Writeln(PadR('[ Random Events Found: ' + IntToStr(Integers[RANDOMEVENT]), 66) + ']');
Writeln(PadR('[ Breaks: ' + IntToStr(Integers[BREAKS]), 66) + ']');
end;
Writeln('[================================================== ===============]');
end;

procedure Setup_Player;
begin
LogInPlayer;
SetAngle(True);
startLevel := GetSkillLevel('magic');
Writeln('Current Magic Level: ' + IntToStr(startLevel) + '.');
end;

procedure Setup_Script;
begin
Writeln('Loading, please wait...');
Smart_Server := SmartWorld;
Smart_Members := SmartMembers;
Smart_Signed := SmartSigned;
Smart_SuperDetail := SmartSuperDetail;
SetupSRL;
DeclarePlayers;
Disguise('Items alched: 0');
end;

procedure Alch_items;
var
a,b,r: Integer;
begin
if (not LoggedIn) then
Exit;
begin
a:=0;
r:=0;
b:=RandomRange(40, 50);

repeat
if(GameTab(tab_Magic)) then
begin
Mouse(643+RandomRange(-5,5), 230+RandomRange(-5,5), 3, 3, True);
Wait(RandomRange(120, 200));
Mouse(660+RandomRange(-5,5), 228+RandomRange(-5,5), 3, 3, True);
Wait(RandomRange(1050, 1200));
a:=a+1;
r:=0;

with Players[CurrentPlayer] do
begin
Integers[Alchs] := Integers[Alchs] + 1;
Disguise('Items Alched: ' + IntToStr(Players[CurrentPlayer].Integers[Alchs]));
Setup_Report_Loop;
Levelup;
if (Levelup) then
begin
with Players[CurrentPlayer] do
begin
Integers[Levels] := Integers[Levels] + 1;
end;
end;

if(Integers[Alchs]=Integers[TAlchs]) then
begin
Writeln('Alched desired number of items, exiting.');
Setup_Report;
Logout;
TerminateScript;
end;
end;
end else
begin
Find_Randoms; //added in until I can fix the part below
{ Writeln('Can''t find magic tab, possibly in a random!');
Find_Randoms;
r:=r+1;
if (r=5) then
begin
Writeln('Can''t find magic tab or solve random after 5 tries, exiting.');
Setup_Report;
Logout;
TerminateScript;
end; }
end;
until(a>b);

Wait(RandomRange(100, 1000));
Find_Randoms;
Create_Antiban;
end;
end;

procedure Setup_MainLoop;
var
sinceLogin: Integer;
begin
Setup_Script;
sinceLogin := 0;
MarkTime(sinceLogin);
Setup_Player;
repeat
Alch_items;

if (Players[CurrentPlayer].Booleans[TAKE_BREAKS]) then
if (TimeFromMark(sinceLogin) >= (60*60000+RandomRange(-300000, 300000))) then
begin
Setup_Report;
Next_Break;
MarkTime(sinceLogin);
end;

until(AllPlayersInactive);
end;

begin
Setup_MainLoop;
end.

The only part that doesn't work really well is


begin
Find_Randoms;
{ Writeln('Can''t find magic tab, possibly in a random!');
Find_Randoms;
r:=r+1;
if (r=5) then
begin
Writeln('Can''t find magic tab or solve random after 5 tries, exiting.');
Setup_Report;
Logout;
TerminateScript;
end; }
end;


it was randomly logging me out so i just took the logout part out and had it look for randoms

slackeru
08-03-2010, 10:11 PM
Thanks alot! I figures that the author of this script was very clever. Only showing the misc spells, these are the same for both p2p and f2p, the other alcher I've tried won't work because the spellbook is different from f2p and p2p.

Thanks for the edit, I liked the thing you did with the logout :P neat

marksteele
08-03-2010, 11:54 PM
Thanks alot! I figures that the author of this script was very clever. Only showing the misc spells, these are the same for both p2p and f2p, the other alcher I've tried won't work because the spellbook is different from f2p and p2p.

Thanks for the edit, I liked the thing you did with the logout :P neat

yah its working fine now, after i figure out that other part I'll post a new script in the original thread for it. (I think I know what I have to do but who knows :P)

btw I read what you said in one of the other threads about wanting to learn to code, google some scar tuts, and then take a script that's working and fiddle around to see how it works, then take a script that's small and outdated, and see if you can keep the structure of the script while updating it. Its working well for me, and its a great way to learn to work with includes.

slackeru
08-04-2010, 01:03 AM
yah its working fine now, after i figure out that other part I'll post a new script in the original thread for it. (I think I know what I have to do but who knows :P)

btw I read what you said in one of the other threads about wanting to learn to code, google some scar tuts, and then take a script that's working and fiddle around to see how it works, then take a script that's small and outdated, and see if you can keep the structure of the script while updating it. Its working well for me, and its a great way to learn to work with includes.

Oh, thanks. Sounds great, I'll do that :)