SRL Archive - OSR Help

How do I get my XP counter to run smoother?


Sir Ducksworthy

2012-03-14 20:07:58

GNOMG! I got it working its so sexy I wish I could post a video because it's switching so fast I bet noones ever seen a Chicken Fighter like that before..
RESOLVED:
So yeh basically I made an on screen XP counter for a chicken fighter Im developing to make it quickly change to the next chicken. 
Since the chicken can only give you a maximum 16 each time it find's one of the numbers rising on the screen it -'s it from the 16 until it's 0 when it's 0 it find's another chicken. It's quicker than waiting for the HP Bar to drop.

It only rarely work's sometimes, I'm not sure what to do because I really want this to be a part of my script can anyone make this run smoother?

Whats the better method to do this?
Should I use bitmaps?
[SIMBA]if(xp1f=false)then begin if(finddtm(xp1,x,y,206,3,303,193))then begin expleft:=expleft-1; xp1f:=true; end; end;
if(xp2f=false)then begin if(finddtm(xp2,x,y,206,3,303,193))then begin if(xp1f=true)then expleft:=expleft-10; expleft:=expleft-2; xp2f:=true; end; end;
if(xp3f=false)then begin if(finddtm(xp3,x,y,206,3,303,193))then begin if(xp1f=true)then expleft:=expleft-10; expleft:=expleft-3; xp3f:=true; end; end;
if(xp4f=false)then begin if(finddtm(xp4,x,y,206,3,303,193))then begin if(xp1f=true)then expleft:=expleft-10; expleft:=expleft-4; xp4f:=true; end; end;
if(xp5f=false)then begin if(finddtm(xp5,x,y,206,3,303,193))then begin if(xp1f=true)then expleft:=expleft-10; expleft:=expleft-5; xp5f:=true; end; end;
if(xp6f=false)then begin if(finddtm(xp6,x,y,206,3,303,193))then begin if(xp1f=true)then expleft:=expleft-10; expleft:=expleft-6; xp6f:=true; end; end;
if(xp7f=false)then begin if(finddtm(xp7,x,y,206,3,303,193))then begin expleft:=expleft-7; xp7f:=true; end; end;
if(xp8f=false)then begin if(finddtm(xp8,x,y,206,3,303,193))then begin expleft:=expleft-8; xp8f:=true; end; end;
if(xp9f=false)then begin if(finddtm(xp9,x,y,206,3,303,193))then begin expleft:=expleft-9; xp9f:=true; end; end;
if(xp10f=false)then begin if(finddtm(xp10,x,y,206,3,303,193))then begin expleft:=expleft-10; xp10f:=true; end; end;
if(expleft=0)then begin timesup:=6500; writeln('Method worked'); end; [/SIMBA]

tehq

2012-03-14 20:23:20

You could store the initial xp as a variable and then use GetXpBarTotal until the initial amount is +16 higher. Then set the xp as the new amount, wait till its +16 and repeat.

Sir Ducksworthy

2012-03-14 20:47:04

Should I use bitmap's to detect the writing? I'm not sure if it would be fast enough tho, XPBar Total would not work, what I mean is It detects the XP'up's that rise to the total bar, Maybe Dtm's are not accurate enough tho.

tehq

2012-03-14 21:07:09

Ah, so you're trying to read the +xp that goes to the counter? I think a Dtm would be able to detect that just fine. I'm not really familiar with the xp counter since i usually have it toggled off, but i'd be glad to help with this. Did i understand correctly?

Sir Ducksworthy

2012-03-14 21:09:44

Yeah that's exactly what I'm doing, Kool Ill try redoing them and see if it makes a difference