I love SRL, but some of the functions just won't cut it.
This first one looks for the colour of the hits in combat (the red and blue symbols) within 100 pixels of the mscx and mscy.
It has to wait 1-1.5 seconds though, so you best use it in conjuction with eating:Code:Function Findhits : Boolean; var a, x, y : Integer; begin a:= getsystemtime; repeat wait(20 + random(20)); if(FindColorTolerance(x, y, 192, 3, 3, 515, 336, 1) or FindColorTolerance(x, y, 167728128, 3, 3, 515, 336, 1))then if(x < 305) and (x > 205) and (y < 216) and (y > 116)then result:= True; until(result = True) or ((getsystemtime - a) > (1000 + random(500))) end;
Burying bonesCode:Function Findhitsandeat : Boolean; var a, x, y : Integer; begin a:= getsystemtime; repeat wait(20 + random(20)); if(HpPercent < 50)then begin if(InvCount > 0)then begin repeat Eat; until(HpPercent > 85) end else Escape; end; if(FindColorTolerance(x, y, 192, 3, 3, 515, 336, 1) or FindColorTolerance(x, y, 167728128, 3, 3, 515, 336, 1))then if(x < 305) and (x > 205) and (y < 216) and (y > 116)then result:= True; until(result = True) or ((getsystemtime - a) > (1000 + random(500))) end;
Yeah I know there is a new random, this is just good.
Any criticism is welcomedCode:procedure DoBones; begin bonebmp := BitmapFromString(27, 20, 'z78DACD55D18EE3200CFC254' + '2626C3FDA06FEFF93CEC559295136DDF4D2DE6D90AC1642187B66' + '0C94A52E196EC4F478A68870FB6BEF8D81AA529D6B962659F211E' + '7FF45BE22EC55ABAA48971E3373CA29167D359998FC4B9C5B4E23' + '366AD0C0B2B2D276BE629DEAA4A659BFD9F53954552A54B06EE40' + '3FC7C8BEA05CB3E99E9ABB65C7DB3BF952C297A21551626266AB4' + 'D0F22ACE638EDB6866E0C3CFF101E28FFFC878BA6BC772759D121' + '752526C58B014840E3B3D5CC1164CADF519785C5A8B2E9219B960' + '2A5428E211C9316E6B18199D657105E116672F9E1CD4D9315A645' + 'AE0017CC772F39339EA79E65CCF3359DF623BCBE5EFF4A6E49AAA' + '67AC757E8CE06E54BA1EEB13393E57CEF3F843F7D8F48723773B8' + 'F8C5CBCA49973E821566346270181F04838DA6675BB8477E24D77' + '52B316EA8A5DC83861BA82F3C8C58A707495389D1BCF3CBB07264' + 'A2BFB6A8BCDAC9C38C9C4C0208585F991B2A415F3603F3A80762D' + 'FE7F64F7AA4ACF564FFD3E2A23E2A8DB7536A3B611792121BEEEF' + '1E771E7D9B853467D9EFBE2CCF5CCD4A9BDDA85AE77CE50DAB657' + 'BFFAFD3B5DE81B1F8DBBCCF58D56C2CBD139EF7FFFCEDE1DC2E1B' + 'EF52ECB825208D050DFA59FF7DED1E1534A4848BF07E11667F410' + '62ECD87E1BC2F72AFCD3F1D3D8FE0087C3AEDF'); repeat FindItemBmpTol(bonebmp, 20) MMouse((x + 6), (y + 6), 2, 2); wait(50 + random(50)); GetMousePos(x, y); Mouse(x, y, 0, 0, True); wait(50 + random(50)); until(not(FindItemBmpTol(bonebmp, 20))) FreeBitMap(bonebmp); end;![]()






Reply With Quote


)





I just used a common background colour and it still sort of works, I'll give that tiny bmp a go 1st, I suspect it's 3*3 pixels or something XD Ah well... Thanks for the advice and help guys. Pyro is right about the 100*100 search, I noticed the place goes about that far from the centre. I wasn't quite sure that people would be fighting that close to each other, the thought never occured. Perhaps something in SRL to track our player's position or something..

