SRL Archive - OSR Help

Fire burning :(


Littellj

2012-04-03 16:24:38

Ok, this is bugging me really bad. Does anyone have any ideas/ working functions that i could use to check to see if there is a fire under my char? Any ideas/brain storming will be appreciated! I looked at the firemaking scripts and their no bueno.

Sin

2012-04-03 16:25:56


x := MSCX;
y := MSCY;
if FindColorSpiralTolerance(x,y,FireColor,Yayadadaa) then
writeLn('Found fire');

Littellj

2012-04-03 16:28:03

Yeah, Just thought of that, Do you reckon as box around the players feat would work better to see if he's standing on it?

Sin

2012-04-03 16:29:36

Yes, make a box around the player, name it tbox, and for the bounds put TBox.x1, TBox.y1, etc..

Joe

2012-04-06 12:48:49

Wouldn't color finding be a bit better that box? It works for me but if this method is better then I should change it?

Abu

2012-04-06 12:53:07

From: JOEbot
Wouldn't color finding be a bit better that box? It works for me but if this method is better then I should change it?


It is color finding, but color finding within a box around the players feet - much more accurate

EtherFreak

2012-04-06 13:17:13

Another method would to use the text seen in the chat box "you can't light a fire here" to determine that you have a fire under you. This also could be used as your failsafe in case your usual detection did not see it, or you burn yourself into a corner.

if IsChatBoxTextBetween ('ere',clBlack,8,8) then

Abu

2012-04-06 13:21:40

^^^^I tried using that function once (a similar one anyway) but it wouldn't work for me….


EDIT: Something like FindChatBoxText

EtherFreak

2012-04-06 16:53:26

From: abu_jwka
^^^^I tried using that function once (a similar one anyway) but it wouldn't work for me….


EDIT: Something like FindChatBoxText


It can be a little tricky to remember which line it is looking on, and it can fail if there is a spam bot in the area. It works reasonably well in my firemaker, I just need to make sure I dont run onto another fire when it detects it cant light a fire.

J J

2012-04-06 17:03:45

This is a part of my failsafe

  { Failsafe when standing on a fire }
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.09, 0.62);
if FindColorSpiralTolerance(X, Y, 536379, 244, 159, 276, 193, 3) then
{ Standing in a fire, moving }
begin;
MouseBox(211, 99, 318, 161, 1);
Wait(1200 + Random(800));
end;
{ Light a log }
Logs := DTMFromString('mAAEAAHiclcvBCkBAFIXhY9aewjNIyUISK5Pm8SeUhbJB3oC/WFiaW9+pU+fGkmojVciRIX2V6OBg0aLBws+AEbOevuPEhhUTPA70RUJGv11Ba8kE7r93A1hgD7U=');
if FindDTM(Logs, X, Y, MIX1, MIY1, MIX2, MIY2) then
begin
MMouse(X, Y, 2, 2);
Mouse(X, Y, 0, 0, 0);
WaitOptionMulti(['ight', 'Light'], 150);
Wait(600 + Random(300));
if not(FindDTM(Logs, X, Y, MIX1, MIY1, MIX2, MIY2)) then
begin
Inc(BurnedLogs);
end else
begin
FindDTM(Logs, X, Y, MIX1, MIY1, MIX2, MIY2)
MMouse(X, Y, 2, 2);
Mouse(X, Y, 0, 0, 0);
WaitOptionMulti(['ight', 'Light'], 150);
end;
end;
FreeDTM(Logs);
{ Check for fire animation }
PBox := IntToBox(282, 145, 320, 195);
FindNormalRandoms;
Marktime(q);
repeat
Wait(100 + Random(100));
Antiban;
Wait(100 + Random(100));
until (Animating(PBox, 100, 200)) or (TimeFromMark(q)>10000);
WriteLn('We have ignited a log')
Wait(150 + Random(250));