Ok...I'm not sure how to use infight with an if command...i mean...do I just go
If Infight Then
begin
code here
end
any help would be much appreciated.
Ok...I'm not sure how to use infight with an if command...i mean...do I just go
If Infight Then
begin
code here
end
any help would be much appreciated.
Yeah, just like that.
If InFight then OutFight;
It is just a boolean, if your charachter is in a fight, it returns true. The example above; If you char is in a fight, it waits until the fight is over.
Scripts: Varrock Smither! | Fight Caves Runner! | Kebab Buyer! | L.A.M.E. (Outdated)
Tutorials: SRL user-defined procedures | JaGex UID files | Printing your scripts
Applications: StartUp Notepad | SCAR Assistant
Misc: FREE Delphi 7 v2 | Official SRL Graphics
Scripts: Varrock Smither! | Fight Caves Runner! | Kebab Buyer! | L.A.M.E. (Outdated)
Tutorials: SRL user-defined procedures | JaGex UID files | Printing your scripts
Applications: StartUp Notepad | SCAR Assistant
Misc: FREE Delphi 7 v2 | Official SRL Graphics
Stop giving wrong answers, hermpie. If YOU look in the SRL include, you'll see that InFight returns true if you're in a fight and OutFight checks if you're in a fight, and if so, waits until you're not in a fight.
EvilChicken was right and hermpie needs to stop posting incorrect answers.
:-)
Thanks so much!
I was .. Kinda moved by what you wrote, you see; I've had a terrble day. And now, annoying people try to play smart and proove me wrong when all I want is to help, since I've been in the same situation one day, (as we all have) and you just brightenned up my day a little, thanks a huge lot.![]()
![]()
Scripts: Varrock Smither! | Fight Caves Runner! | Kebab Buyer! | L.A.M.E. (Outdated)
Tutorials: SRL user-defined procedures | JaGex UID files | Printing your scripts
Applications: StartUp Notepad | SCAR Assistant
Misc: FREE Delphi 7 v2 | Official SRL Graphics
I usually use FindFight, I don't know what difference it makes using FindFight or InFight.
If you're making a Skill-Script (Woodcutting, Mining, Smithing, etc.) then you should use RunAwayDirection and RunBack, but if you're making an autofighter, then use EvilChickens idea.
-Knives
Scripts: Varrock Smither! | Fight Caves Runner! | Kebab Buyer! | L.A.M.E. (Outdated)
Tutorials: SRL user-defined procedures | JaGex UID files | Printing your scripts
Applications: StartUp Notepad | SCAR Assistant
Misc: FREE Delphi 7 v2 | Official SRL Graphics
ok...so they are all booleans and I can use them like so...
if infight then
begin
code...
end;
what about repeats?
repeat
code
until(infight=false)
how would I do that one?
Yea it is. Why are you using that many paranthesises?
could beSCAR Code:(If (not(InFight) then AttackThoseMonsters));
SCAR Code:if not InFight then AttackThoseMonster
Much easier to understand.
and yea, FindFight is a boolean aswell, but what it does is:
Checks for red and green HP-Bar color above your chars head. Then it checks GameTab(2) (statistics screen), and if your HP is below your Maxhp then it will result true.
EDIT: To post above: Yea, that would be an idea. It will repeat your code until you aren't in a fight.
-Knives
Scripts: Varrock Smither! | Fight Caves Runner! | Kebab Buyer! | L.A.M.E. (Outdated)
Tutorials: SRL user-defined procedures | JaGex UID files | Printing your scripts
Applications: StartUp Notepad | SCAR Assistant
Misc: FREE Delphi 7 v2 | Official SRL Graphics
I just want to know all of its capabilities...before I write scripts I want to know everything and their limits.
For example say i'm fighting....bears...
I want something like this (Just wrote it off the top of my head btw)...
*i'm a noob to scripting..so if this script is bad plz dont' make fun of me*
SCAR Code:program bearkiller;
{.include SRL/SRL.scar}
Procedure FindBear;
Begin
repeat
wait(1000)
If FindObj(x, y, 'ear', Bearcolor, 10) then
begin
exit;
end;
until false
end;
Procedure AtkBear;
Begin
Mouse(x, y, 0, 0, false);
ChooseOption('Attack');
end;
Begin
setupsrl;
repeat
wait(5000)
FindBear;
AtkBear;
repeat
wait(1000)
until(infight=false)
until(false)
end.
SCAR Code:Program LeetbearKiller;
{.include SRL/SRL.scar}
{.include srl/srl/skill/fighting.scar}
// THE "FIGHTING.scar" NEEDS TO BE ADDED BECAUSE IT IS A SPECIAL INCLUDE FOR FIGHTING.
// Or else, the InFight and other fighting commands wouldn't work.
Var
X, Y: Integer; // Youorgot to declare variables.
Const
Bearcolor = 1000; // The color of the bear stays the same, right?
Procedure FindBear;
Begin
if not LoggedIn then exit; // A couple of failsafes..
if InFight then exit;
repeat
If FindObj(x, y, 'ear', Bearcolor, 5) then // Too high tolerance. 5 should do it. Maybe even less.
Mouse(x, y, 0, 0, false);
ChooseOption('Attack');
Wait(2000) // Waits 2 secons, 2000 milliseconds.
OutFight; // If, and only if it is in a fight then wait until the fight is over.
until false;
end;
Begin
setupsrl;
FindBear;
end.
Yours wouldn't work, look at the changes I've made. Yours would just repeat finding bears - Try this, and learn from the changes. And, also, you could try to look at my script for more, its a fighting script, so its based on the same. Althrough it isn't at its greatest now, I'm working on an unreleased version of it. As my sig states.
Try reading some guides at the tut isnland, they pwn. Thats how I started. And you also need loopbraks, failsafes and antirandoms. But neat start![]()
Scripts: Varrock Smither! | Fight Caves Runner! | Kebab Buyer! | L.A.M.E. (Outdated)
Tutorials: SRL user-defined procedures | JaGex UID files | Printing your scripts
Applications: StartUp Notepad | SCAR Assistant
Misc: FREE Delphi 7 v2 | Official SRL Graphics
wow...thnx...I knew most of the stuff but didn't think it was all necessary...the ones tips that really helped me was the tolerance issue...and the Outfight..It makes sense now.
Outfight will detect if the user is currently fighting..and if return is true, then will wait until the fight is completed.
THNX!
Remember to look at my script, I believe it got some tuff that could turn out to be useful for you there. And remember to rep if you found my help helpful xD!
Scripts: Varrock Smither! | Fight Caves Runner! | Kebab Buyer! | L.A.M.E. (Outdated)
Tutorials: SRL user-defined procedures | JaGex UID files | Printing your scripts
Applications: StartUp Notepad | SCAR Assistant
Misc: FREE Delphi 7 v2 | Official SRL Graphics
ok...I tried to make a chicken killing script based on what you've shown me...but the Outfight doesn't seem to be working...It just attacks another chicken right after the waits...am I doing something wrong?
SCAR Code:program ChickenMaster;
{.include srl/srl.scar}
{.include SRL\SRL\Skill\Fighting.scar}
Const
CocksComb=858751;
Healthbar=65280;
Feathers=12369093;
var
x,y: integer;
Procedure FindChicken;
Begin
FindObj(x,y,'hicken',CocksComb,10);
Mouse(x, y, 0, 0, false);
wait(500)
ChooseOption('Attack');
end;
Begin
SetUpSRL;
if not LoggedIn then exit;
Repeat
Wait(2000)
FindChicken;
Wait(3000);
OutFight;
Until false
end.
Nononono, like this:
SCAR Code:program ChickenMaster;
{.include srl/srl.scar}
{.include SRL\SRL\Skill\Fighting.scar}
Const
CocksComb=858751; // Chicken color, I suppose?
// Healthbar=65280; Why this?
// Feathers=12369093; No need, as it doesnt pickup those.
var
x,y: integer;
Procedure FindChicken;
Begin
FindObj(x,y,'hicken',CocksComb,10);
Mouse(x, y, 0, 0, false);
wait(50 + random (50)); // 50, not 500.
ChooseOption('Attack');
Wait(800 + random (200));
OutFight;
end;
Begin
SetUpSRL;
if not LoggedIn then exit;
Repeat
// Wait(2000) No need.
FindChicken;
// Wait(3000); NO
// OutFight; Need.
Until false;
end.
Glad to see you're learning quick.
Scripts: Varrock Smither! | Fight Caves Runner! | Kebab Buyer! | L.A.M.E. (Outdated)
Tutorials: SRL user-defined procedures | JaGex UID files | Printing your scripts
Applications: StartUp Notepad | SCAR Assistant
Misc: FREE Delphi 7 v2 | Official SRL Graphics
Hey! Thnx! I just got back. But there are a few problems. After attacking a chicken, it just goes out and attacks another...It doesn't wait for the first chicken to die. Should the Outfight wait until the first fight is over?
As far as the feathers and healthbar are concerned...I wanted to later make it so it'll pick up feathers. I also wanted to get the users health, but I forgot I could just go to Gametab, so that'll be gone too...lol!
User-health-thing.. Procedure called GetHP;
All there is to it.
(GetHP;
If GetHP < LogOutHP then LogOut
Fighting: So it gets to the point where the two health bars show?
What charachter are you using? Where?
For the feather pickup part, look at Munk's "Forefeathers". I use that script, it pwns.
Scripts: Varrock Smither! | Fight Caves Runner! | Kebab Buyer! | L.A.M.E. (Outdated)
Tutorials: SRL user-defined procedures | JaGex UID files | Printing your scripts
Applications: StartUp Notepad | SCAR Assistant
Misc: FREE Delphi 7 v2 | Official SRL Graphics
Scripts: Varrock Smither! | Fight Caves Runner! | Kebab Buyer! | L.A.M.E. (Outdated)
Tutorials: SRL user-defined procedures | JaGex UID files | Printing your scripts
Applications: StartUp Notepad | SCAR Assistant
Misc: FREE Delphi 7 v2 | Official SRL Graphics
There are currently 1 users browsing this thread. (0 members and 1 guests)