Log in

View Full Version : GetCombatLevel;



Jason2gs
04-14-2007, 01:58 AM
It seem GetCombatLevel is broken. Is it? Or am I just not using it right.

Mr.Klean
04-14-2007, 02:27 AM
I think it is, they don't work in the autofighter i am using and they worked before

Boreas
04-14-2007, 02:48 AM
program New;
{.include srl\srl.scar}

function getcombatlevelb:integer;
var
melon, i: integer;
eagle : string;
begin
melon:=getcurrenttab;
gametab(1);
eagle:= GetTextAtEx(671, 230, 100, StatChars, False, True, 0, 5, -1, 2, True, tr_Digits);
if (Trim(eagle) = '') then
for i := 1 to 5 do
begin
eagle := GetTextAtEx(671 + i, 230, 100, StatChars, False, True, 0, 5, -1, 2, True, tr_Digits);
if (Trim(eagle) <> '') then Exit;
end;
if (not (Trim(eagle) = '')) then
result := StrToInt(Trim(eagle));
wait(500+random(200));
gametab(melon);
end;

begin
setupsrl;
writeln(inttostr(getcombatlevelb));
end.

no idea if it still works


edit: I just checked and both work for me, how are you using it?

Jason2gs
04-14-2007, 02:58 AM
Like this:


program New;
{.include SRL/SRL.Scar}
begin
SetupSRL;
ActivateClient;
Writeln(IntToStr(GetCombatLevel));
end.


I wanted to make an obfuscated If-Combat-Level-Is-Lower-Than-20-Then-Logout thing.

Boreas
04-14-2007, 03:03 AM
Works for me...

(BTW, the combat level checker should be in SRL 4.0)

Jason2gs
04-14-2007, 03:21 AM
Ah, cool :)

Any idea when SRL 4.0 will be out?

Boreas
04-14-2007, 09:40 AM
Not really. At least a week.

Markus
04-14-2007, 09:51 AM
Don't you get some serious problems with a combat level checker in SRL?
Most people say that you can use the goblin scheduler to raise the first 20 combat levels, but the goblin scheduler uses SRL (as it's the first SRL script). As SRL 4.0 will refuse to work without a level 20 character, the goblin scheduler won't work. Or is there some kind of variable checkcombatlevel that you can turn to false as a scripter?
BTW, your code works fine for me, Jason. It returns my combat level.

Boreas
04-14-2007, 10:01 AM
It won't be in login player lol. It will be a procedure that scripts can call if they want. Obviously they won't call it in noob fighters.

Markus
04-14-2007, 11:05 AM
Ok, I thought it was in loginplayer. Stupid me :duh:.
But it's an excelent idea, an anti-lv3 procedure. But I think most people here don't use lv3's to auto with.

Jason2gs
04-14-2007, 09:42 PM
When I run my script, it returns my combat level as zero.

gsquare567
04-14-2007, 09:45 PM
two reasons that can happen:
a. you need GameTab(1) before
b. you are not getting text in the right area, try resetting the coordinates

Jason2gs
04-14-2007, 09:50 PM
I'll try it in the new Divi.

If it doesn't work because of the Coords, then why should it work in other people's SCARs?

Edit:



Could Not Get Combat Level
0


:rolleyes:

gsquare567
04-14-2007, 10:22 PM
the only other thing i can think of is u didnt drag the cross onto the client. maybe it also doesnt have 'ActivateClient' in the code

syberium
04-15-2007, 07:26 AM
Do something like this:


program CBLVL;
{.include SRL\SRL.scar}

Var
Clvl : Integer;

Procedure GetThatLevel;
begin
Clvl := GetCombatLevel;
end;

procedure AreYouANoob;
begin
if (Clvl < 20) Then TerminateScript;
end;


begin
SetUpSRL;
GetThatLevel;
AreYouANoob;
end.

Should Compile i just made it up though ^^ thats a basic noob blocker but ne1 with any scar knowledge could easily disable it lol