SRL Archive - SRL Snippets

UseAbility


Roflme

2012-11-21 15:48:44

Another SIMPLE EoC function, BUT NOTE IT IS NOT FULLY FUNCTIONING YET. Right now it's set up to ONLY work with 1. Place an ability in the very first slot and see if this works. I need to get the center of the other boxes later.

May need to play with the wait times because those were giving me problems. If it continues to not work PLEASE POST the ABILITY you used.

procedure useActionKey(s:string); // Sends the key
begin
TypeSendEx(s, false)
end;

function AbilityUsed:Boolean; // If the color changes then it means the ability
begin // has been used
Result := CountColor(Color, 59, 308, 61, 310) < 1;
if Result then
Writeln('Used Ability');
end;

function UseAbility(s:string):Boolean; // Uses an ability, comes back as true
begin // if it was successfully used.
Color := GetColor(60, 309);
useActionKey(s);
Wait(RandomRange(900,1000));
Result := AbilityUsed;
end;


And random question:
Does anyone know if srl_InFight was affected by the EoC? Or is it still working/updated?

Ian

2012-11-21 15:51:08

SRL_InFight was buggy before EOC, have not tried it yet with EOC. I'll check.

Silentcore

2012-11-21 15:59:27

Just when you posted about the bar, I was also thinking of the effects. nice Job once again, I might do my own little functions.

Ian

2012-11-21 16:13:58

I thought of an accurate way to detect when your fight is over, but it won't detect when you are fighting.

Ashaman88

2012-11-21 16:36:16

Why not just manage it from the combat tab? It shows if you are in fight or not and you can see when the green bar from your opponent is all gone (dead) in that same tab

Roflme

2012-11-21 19:06:35

From: Ashaman88
Why not just manage it from the combat tab? It shows if you are in fight or not and you can see when the green bar from your opponent is all gone (dead) in that same tab


Didn't even notice that, thank you! :p

I'll try once more fixing up the functions but I was having some issues with coordinates :( they kept changing on me.




And if anyone has a better suggestion please post it! I'm trying to think of different ways to detect when the ability is used and this is the only one I can think of. In the long run I think it'd be better to just get a bitmap/dtm of each ability and have a cooldown linked to them.

EDIT: Every time I come back to try scripting my real life gets me tangled up. I'm going to be looking into this A LOT. As soon as my computer is back up and running I'm going to look into beginning to create DTMs/Bitmaps of each individual ability, so I have a way of telling each individual ability apart. Then, each one will be given a cooldown timer. I'm thinking how to implement this into a series of functions. I'd imagine I'd do something simple, something like:


t := getSystemTime + CoolDown
while t > getSystemTime do
Result := false;

if that would even work (????). Since I've never done anything like this I'm a little unsure of what simba is capable of doing. Would a script be able to run other functions (say, for killing multiple mobs) and throughout killing them know what abilities will be on cooldown and which ones will not be?

I'll have to test those.

Any advice is highly appreciated.