Log in

View Full Version : In Need Help' With Script.



Pukka
07-29-2012, 01:18 PM
Trying to get a script to work. Spent around 3 hours trying to fix it, Done some issues I've had. Come across this problem. Add me on Skype also if you can help me with my learning of scripting. Skype; RSPSKYLE *edit, I've also looked at other scripts and tried to change my DeclarePlayers but still same problem. Be nice im new :)


[Error] C:\Simba\Scripts\Incubator - Latest Version.simba(17:3): Unknown identifier 'HowManyPlayers' at line 13
Compiling failed.

Here is my DeclarePlayers;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name:= '';
Pass:= '';
Nick:= '';
pin:= '';
Active:= True;
Loads:= 6000;
BoxRewards := ['XP','xp','lamp'];
LampSkill := 'Summoning';
end;
loginplayer;
startexp:= GetXPBarTotal
loginplayer;
end;

riwu
07-29-2012, 01:22 PM
You dont have {$i SRL/srl.simba} at the start of the script. LampSkill parameter has also been changed, u should put SKILL_SUMMONING. And its better not to put LoginPlayer in DeclarePlayers, not much harm though i think. But why call LoginPlayer twice?

Pukka
07-29-2012, 01:29 PM
Thankyou riwu, Adding {$i SRL/srl.simba} at the start did fix that. Will try to rep you.

riwu
07-29-2012, 01:32 PM
Np. Be sure to have SetupSRL; in your main program too. I suggest that you watch yohojo's video tutorials (http://www.youtube.com/watch?v=pMMejhyjGwI) as they are said to be good and easy to follow for beginners ;)

Pukka
07-29-2012, 01:42 PM
Yes, I've watched 3 videos I understood more..

Compiled the script fine, But when I try to run it I get this.

Error: Exception: The bitmap[0] does not exist at line 550

Line 535 - 554 " much appreciated If anyone could help with this problem.

(*
GetFightBarTPA
~~~~~~~~~~~

.. code-block:: pascal

Function GetFightBarTPA(SearchArea: TBox): TPointArray;

Used in various fighting functions, including srl_InFight

.. note::

by Narcle

Example:

.. code-block:: pascal


*)

Footy
07-29-2012, 01:51 PM
Have you updated simba, SRL, SPS, and your plugins?

Pukka
07-29-2012, 01:55 PM
Have you updated simba, SRL, SPS, and your plugins?

Yes, All have been updated today.

Justin
07-29-2012, 02:07 PM
Try adding:


SetupSRL;

Pukka
07-29-2012, 02:14 PM
SetupSRL; Was already there as a new untitled page in simba, Below is the code. So Confusing as I'm so new to this, hope to get the hang of it soon. Thanks for trying to help though.


begin
{$IFDEF SMART}
{$IFDEF SIMBAMAJOR980}
Smart_Server := 5;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
{$ELSE}
SRL_SixHourFix := True;
Smart_FixSpeed := True;
{$ENDIF}
{$ENDIF}

DeclarePlayers;
SetupSRL;

end.

riwu
07-29-2012, 02:19 PM
Try calling it before DeclarePlayers.

SetupSRL;
DeclarePlayers;

Pukka
07-29-2012, 02:29 PM
OK I tried doing that.. Got Error; This is how I did what you told me to do & Compile error below it.


begin
SetupSRL;
DeclarePlayers;
end;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name:= '';
Pass:= '';
Nick:= '';
pin:= '';
Active:= True;
Loads:= 6000;
BoxRewards := ['XP','xp','lamp'];
LampSkill := Skill_Summoning;
end;
loginplayer;
startexp:= GetXPBarTotal
loginplayer;
end;

Compile Error;

[Error]Unknown identifier 'DeclarePlayers' at line 14

riwu
07-29-2012, 02:36 PM
The main program should always be at the btm of the script, and it ends with a full stop.
program new;
{$i SRL/srl.simba}
var
startExp, Loads: Integer;
//may want to change Loads to constant if its not going to change during runtime of script


procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name:= '';
Pass:= '';
Nick:= '';
pin:= '';
Active:= True;
Loads:= 6000;
BoxRewards := ['XP','xp','lamp'];
LampSkill := Skill_Summoning;
end;
end;

begin
SetupSRL;
DeclarePlayers;
loginplayer;
ToggleXPBar(true); //must toggle it incase its not
startexp:= GetXPBarTotal;
repeat
//Here is ur mainloop for ur procedures
until(false);
end.

Pukka
07-29-2012, 02:39 PM
Thankyou very much for your help again Riwu :D!

Pukka
07-29-2012, 05:03 PM
Sorry to bump this thread, but didn't want to make another thread,

Problem I'm having is;- it opens the bank hoover's over pot + scroll but does not withdraw, but withdraw's 26 (eggs).. It looks right in the code but I'm not sure can anyone help me?

Footy
07-29-2012, 05:04 PM
Can you post the script you are using, and what exactly do u want it to do.

Pukka
07-29-2012, 05:15 PM
Can you post the script you are using, and what exactly do u want it to do.

The link of the script is here. http://villavu.com/forum/attachment.php?attachmentid=13488&d=1327844197

Basically it, uses the cwars bank, summons a spirit cobra opens bank back up, withdraw 1 summoning pot and scrolls, with 26 eggs then it makes eggs into cockatrice eggs, banks all, repeat. But it DOESN'T withdraw the pot or scrolls just hoovers over them. It does withdraw the eggs. Here is my;- SetUpInventory

procedure SetUpInventory;

var
withdrawalscrolls:Integer;

begin
Writeln('...Setting up inventory');
OpenTheBank;
withdrawalscrolls:= (GetBankIndexItemAmount(13) + 1); // slot 13 scrolls
wait(500+random(500));
WithdrawEx(2, 1, withdrawalscrolls, ['ph.']);
WithdrawEx(1, 1, 1, ['ummoning potion']); // slot 12 pouch slot 11
WithdrawEx(9, 0, 26, ['gg']); //slot 10 eggs
Writeln('Completed inventory setup.');
CloseTheBank;
end;

Here is Initialsetup
procedure InitialSetup;

begin
Writeln('++Begin Initial Setup++');
WithdrawPouch;
SummonPouch;
OpenTheBank;
StartEggs:= GetBankIndexItemAmount(10);
StartPouches:= GetBankIndexItemAmount(11);
StartPotions:= GetBankIndexItemAmount(12);
StartScrolls:= GetBankIndexItemAmount(13);
SetUpInventory;
Writeln('++Completed Initial Setup++');
end;

Anything else you want to see please tell me. Really stuck with this been doing it for hours. :(

Footy
07-29-2012, 05:45 PM
I've never used these functions, so I'm not sure if you are doing it right or not. Id just make a DTM for your items, then use findDTM, then mouse(x, y, 5, 5, 1). Sorry u couldn't be of more assistance.

riwu
07-29-2012, 09:33 PM
The link of the script is here. http://villavu.com/forum/attachment.php?attachmentid=13488&d=1327844197

Basically it, uses the cwars bank, summons a spirit cobra opens bank back up, withdraw 1 summoning pot and scrolls, with 26 eggs then it makes eggs into cockatrice eggs, banks all, repeat. But it DOESN'T withdraw the pot or scrolls just hoovers over them. It does withdraw the eggs. Here is my;- SetUpInventory

procedure SetUpInventory;

var
withdrawalscrolls:Integer;

begin
Writeln('...Setting up inventory');
OpenTheBank;
withdrawalscrolls:= (GetBankIndexItemAmount(13) + 1); // slot 13 scrolls
wait(500+random(500));
WithdrawEx(2, 1, withdrawalscrolls, ['ph.']);
WithdrawEx(1, 1, 1, ['ummoning potion']); // slot 12 pouch slot 11
WithdrawEx(9, 0, 26, ['gg']); //slot 10 eggs
Writeln('Completed inventory setup.');
CloseTheBank;
end;

Here is Initialsetup
procedure InitialSetup;

begin
Writeln('++Begin Initial Setup++');
WithdrawPouch;
SummonPouch;
OpenTheBank;
StartEggs:= GetBankIndexItemAmount(10);
StartPouches:= GetBankIndexItemAmount(11);
StartPotions:= GetBankIndexItemAmount(12);
StartScrolls:= GetBankIndexItemAmount(13);
SetUpInventory;
Writeln('++Completed Initial Setup++');
end;

Anything else you want to see please tell me. Really stuck with this been doing it for hours. :(
Are your items at the correct bank position? From the code the scrolls are supposed to be at Column 3, (the first column is column 0), Row 2, and the summoning pot is supposed to be at Column 2, Row 2, and eggs at Column 10, Row 1. The scripter chosen kinna weird positions but you can adjust them.

If its still not working, it means that the uptext is incorrect, try shortening the uptext (in the []) and make sure its spelled correctly in the correct case.