Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MATCH(%@&chatcontent%,"^/%@¤tcmd% (.+)$",{&cmdcontent});
- @#getregionboubds=1;
- @&bounds=;
- #i=0;
- ECHO(/rg i %&cmdcontent%);
- DO;
- INC(#i);
- IF(#i=50);
- BREAK;
- ENDIF;
- UNTIL(%@&bounds%!=);
- @#getregionboubds=0;
- IF(#i<50);
- MATCH(%@&bounds%,"Bounds: \((.+)\) -> \((.+)\)",{&bound1,&bound2});
- IF(%&bound1%!=);
- SPLIT(",",%&bound1%,#bound1);
- SPLIT(",",%&bound2%,#bound2);
- FOR(#i,0,3);
- #tpcoords[%#i%]=#bound2[%#i%]+#bound1[%#i%];
- #tpcoords[%#i%]=#tpcoords[%#i%]/2;
- NEXT;
- ECHO(/tppos %#tpcoords[0]% %#tpcoords[1]% %#tpcoords[2]%);
- #h=0;
- #y=#tpcoords[1];
- WAIT(300ms);
- GETIDREL(0,%#i%,0,&hat);
- IF(%&hat%="air");
- LOG(&9Teleported you to the region &e"%&cmdcontent%");
- ELSE;
- FOR(#i,2,255);
- GETIDREL(0,%#i%,0,&hat);
- IF(%&hat%="air");
- ECHO(/tppos %#tpcoords[0]% %#y% %#tpcoords[2]%);
- LOG("&9Teleported you to the region &e"%&cmdcontent%"");
- #i=#h;
- BREAK;
- ENDIF;
- #y=%YPOS%+#i;
- NEXT;
- ENDIF;
- #border=#bound2[1]-#tpcoords[1];
- IF(#h>#border);
- LOG(&9It is &e%#h% &9blocks below!);
- ENDIF;
- UNSET(&bound1);
- UNSET(&bound2);
- ENDIF;
- ELSE;
- LOG(&cError.);
- ENDIF;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement