SRL Archive - Jr. Member General Help and Discussion

Proggy Help


BigRedJapan

2015-01-03 14:49:34

Can someone help me with my Proggy its telling me there is a Mismatch at the end yet I cant find the problem.

Procedure Proggy;
begin
TotalTime := (GetTimeRunning/1000);
Minutes := TotalTime/60;

XP := (getXp(Skill_Range) - StartXP);
XPRate := Round(((XP*3600)/(GetTimeRunning/1000)));

ClearDebug;

WriteLn('Running for: ' + IntToStr(TotalTime) + ' seconds');
WriteLn('That is: ' + IntToStr(Minutes) + ' minute(s)');
WriteLn('Gained ' + ToStr(XP) + ' exp');
WriteLn('At a rate of ' + ToStr(XPRate) + ' exp per hour');
WriteLn('Xp left to Level' + IntToStr(XPTillNextLevel(Skill_Range) + 'exp');
WriteLn('Aquired ' + IntToStr(GetSkillLevel(Skill_Range)- RangeLev) + ' levels');

end;

cosmasjdz

2015-01-03 15:00:30

From: Rules of Joe

IntToStr(XPTillNextLevel(Skill_Range)



should be like
WriteLn('Xp left to Level' + IntToStr(XPTillNextLevel(Skill_Range)) + 'exp');

BigRedJapan

2015-01-03 15:07:52

Oh shit misssed that thanks.

BigRedJapan

2015-01-03 15:38:16

another stupid question.

I want to use cases for fail safe how would i be able to use them.

Procedure FailSafe;
begin
case (3) of
1: begin FindChatBoxText('Congratulations, you just advanced a Ranged level.', 1, 0); ClickToContinue; FiringTarget; end;
2: begin FindNPCChatTextMulti(['Sorry,', 'may only', 'competition, not'], Nothing); Judge; end;
3: begin FindMod; AddOnTerminate('FREE_DTMs'); TerminateScript; end;
end;
end;

If the code comes across one of those option i want it to pick it out on its own, not to randomize it.

KeepBotting

2015-01-03 15:54:29

From: Rules of Joe
another stupid question.

I want to use cases for fail safe how would i be able to use them.

Procedure FailSafe;
begin
case (3) of
1: begin FindChatBoxText('Congratulations, you just advanced a Ranged level.', 1, 0); ClickToContinue; FiringTarget; end;
2: begin FindNPCChatTextMulti(['Sorry,', 'may only', 'competition, not'], Nothing); Judge; end;
3: begin FindMod; AddOnTerminate('FREE_DTMs'); TerminateScript; end;
end;
end;

If the code comes across one of those option i want it to pick it out on its own, not to randomize it.


case (yourString) of
'this value': begin end;
'that value': begin end;
end;

case (yourBool) of
TRUE: begin end;
FALSE: begin end;
end;
case (yourInt) of
69: begin end;
420: begin end;
end;

bonsai

2015-01-03 15:54:32

From: Rules of Joe
another stupid question.

I want to use cases for fail safe how would i be able to use them.

Procedure FailSafe;
begin
case (3) of
1: begin FindChatBoxText('Congratulations, you just advanced a Ranged level.', 1, 0); ClickToContinue; FiringTarget; end;
2: begin FindNPCChatTextMulti(['Sorry,', 'may only', 'competition, not'], Nothing); Judge; end;
3: begin FindMod; AddOnTerminate('FREE_DTMs'); TerminateScript; end;
end;
end;

If the code comes across one of those option i want it to pick it out on its own, not to randomize it.


Seems like you don't really want a case, just want to test a few different things. A case is more for one item with multiple possible values.


procedure failsafe();
begin
if findMod() then
begin
addOnTerminate('FREE_DTMs');
terminateScript;
end;
if findChatBoxText('Congratulations, you just advanced a Ranged level.', 1, 0) then
begin
clickToContinue();
firingTarget();
exit();
end;
if findNPCChatTextMulti(['Sorry,', 'may only', 'competition, not'], Nothing) then
judge();
end;

BigRedJapan

2015-01-03 16:52:03

Thanks.


Fix the other problem.