1010from pathlib import Path
1111from ping3 import ping
1212
13+ firefox = True
14+
1315# Detect platform
1416PLATFORM = platform .system ().lower () # 'darwin' (macOS), 'linux', 'windows'
1517print (f"Arrasbot running on: { PLATFORM } " )
@@ -178,7 +180,10 @@ def start_input_listener():
178180 time .sleep (0.1 )
179181 controller .tap (Key .enter )
180182 while working :
181- p28925 = get_pixel_rgb (28 , 925 )
183+ if firefox :
184+ targetcolor = get_pixel_rgb (26 , 930 )
185+ else :
186+ targetcolor = get_pixel_rgb (28 , 925 )
182187 if color_close (get_pixel_rgb (1021 , 716 ), (152 , 232 , 241 )):
183188 disconnected = True
184189 log_file .write (f"Backroom crashed at { timestamp ()} \n " )
@@ -205,9 +210,9 @@ def start_input_listener():
205210 # time.sleep(0.1)
206211 # controller.release("`")
207212
208- if (color_close (p28925 , (167 , 81 , 68 )) or color_close (p28925 , (138 , 27 , 34 )) or
209- color_close (p28925 , (201 , 92 , 75 )) or color_close (p28925 , (199 , 118 , 98 )) or
210- color_close (p28925 , (213 , 114 , 93 ))):
213+ if (color_close (targetcolor , (167 , 81 , 68 )) or color_close (targetcolor , (138 , 27 , 34 )) or
214+ color_close (targetcolor , (201 , 92 , 75 )) or color_close (targetcolor , (199 , 118 , 98 )) or
215+ color_close (targetcolor , (213 , 114 , 93 ))):
211216 if get_pixel_rgb (686 , 650 ) == (231 , 137 , 109 ) or get_pixel_rgb (837 , 675 ) == (231 , 137 , 109 ):
212217 log_file .write (f"Temporarily banned at { timestamp ()} \n " )
213218 print (f"Temporarily banned at { timestamp ()} " )
@@ -249,12 +254,12 @@ def start_input_listener():
249254 for _ in range (200 ):
250255 mouse .click (Button .left , 1 )
251256 time .sleep (pingm / 1000 )
252- if color_close (p28925 , (176 , 100 , 81 )) and ((not disconnected or not died ) or ((time .time () - lastdeath ) > 5 and died )):
257+ if color_close (targetcolor , (176 , 100 , 81 )) and ((not disconnected or not died ) or ((time .time () - lastdeath ) > 5 and died )):
253258 print (f"Checking death at { timestamp ()} " )
254259 log_file .write (f"Checking death at { timestamp ()} \n " )
255260 time .sleep (3 )
256- p28925_after = get_pixel_rgb (28 , 925 )
257- if color_close (p28925_after , (176 , 100 , 81 )) and (not disconnected and not died or ((time .time () - lastdeath ) > 5 and died )):
261+ targetcolor_after = get_pixel_rgb (28 , 925 )
262+ if color_close (targetcolor_after , (176 , 100 , 81 )) and (not disconnected and not died or ((time .time () - lastdeath ) > 5 and died )):
258263 take_screenshot ("died" )
259264 log_file .write (f"[DEATH] screenshot taken at { timestamp ()} \n " )
260265 print (f"Died at { timestamp ()} " )
@@ -264,7 +269,7 @@ def start_input_listener():
264269 controller .tap (Key .enter )
265270
266271 # Reconnect detection (tolerant)
267- if color_close (p28925 , (223 , 116 , 90 )) and (disconnected or died ):
272+ if color_close (targetcolor , (223 , 116 , 90 )) and (disconnected or died ):
268273 take_screenshot ("reconnected" )
269274 log_file .write (f"[RECONNECTED] screenshot taken at { timestamp ()} \n " )
270275 print (f"Successfully reconnected at { timestamp ()} " )
0 commit comments