Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ifmatches(%CHATCLEAN%, "^ \* (.+?) (.+?) snitch at ?(.*?) \[([-\w]+?) (-?[0-9]+) (-?[0-9]+) (-?[0-9]+)\]");
- if(@paranoia);
- match(%CHATCLEAN%, "^ \* (.+?) (.+?) snitch at ?(.*?) \[([-\w]+?) (-?[0-9]+) (-?[0-9]+) (-?[0-9]+)\]",{&nick,&action,&sn_name,&sn_world_name,#coord_x,#coord_y,#coord_z});
- calcyawto(%#coord_x%,%#coord_z%,#yaw,#dst_inacc);
- if(%#dst_inacc% <= 500);
- unset(@paranoia);
- //echo("/exit");
- //echo("/g Hjaltland BEEP BOOP! %&nick% hit a snitch near me at [%#coord_x% %#coord_y% %#coord_z%].");
- wait(50ms);
- disconnect;
- endif;
- endif;
- endif;
- ifmatches(%CHATCLEAN%,"^You sense a diamond nearby");
- playsound(entity.player.levelup);
- unset(@automine);
- //slot(9);
- endif;
- Civcraft Snitch Distance - By Squeenix
- //regular expression to grab any three signed numbers separated by spaces
- match(%CHATCLEAN%,"(-?\d+)(?:[^-\d]+-?\d+)(?:[^-\d]+-?\d+[^-\d]*\Z)",&text,1,"NUL");
- if(%&text% = "NUL");
- stop;
- else;
- match(%CHATCLEAN%,"(-?\d+)(?:[^-\d]+-?\d+)(?:[^-\d]+-?\d+[^-\d]*\Z)",#x,1,"NUL");
- match(%CHATCLEAN%,"(-?\d+)(?:[^-\d]+-?\d+[^-\d]*\Z)",#y,1,"NUL");
- match(%CHATCLEAN%,"(-?\d+)(?:[^-\d]*\Z)",#z,1,"NUL");
- //log(%#x% %#y% %#z%);
- //built-in function for relative distance and direction using ints
- calcyawto(%#x%,%#z%,#yaw,#dist);
- //tedious translation of numeric yaw value into strings like "north"
- if((%#yaw% > 337) || (%#yaw% <= 22));
- set(&dir,south);
- elseif((%#yaw% > 22) && (%#yaw% <= 67));
- set(&dir,southwest);
- elseif((%#yaw% > 67) && (%#yaw% <= 112));
- set(&dir,west);
- elseif((%#yaw% > 112) && (%#yaw% <= 157));
- set(&dir,northwest);
- elseif((%#yaw% > 157) && (%#yaw% <= 202));
- set(&dir,north);
- elseif((%#yaw% > 202) && (%#yaw% <= 247));
- set(&dir,northeast);
- elseif((%#yaw% > 247) && (%#yaw% <= 292));
- set(&dir,east);
- elseif((%#yaw% > 292) && (%#yaw% <= 337));
- set(&dir,southeast);
- endif;
- //is it above or below you to within 40 blocks?
- if(%#y% > %YPOS%+40);
- set(&height, and above you);
- elseif(%#y% < %YPOS%-40);
- set(&height, and below you);
- else;
- set(&height,"");
- endif;
- //colorization and chatbox output
- if(%#dist%<1000);
- log(&c %#dist% blocks%&height% to the %&dir%);
- elseif(%#dist%<2000);
- log(&a %#dist% blocks%&height% to the %&dir%);
- else;
- log(%#dist% blocks to the %&dir%);
- endif;
- endif;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement