Toph Posted December 20, 2013 Posted December 20, 2013 (edited) This will return the character that your fairy ring interface shows. public char getRingPosition(int ring) { int s = script.client.getConfig(816); int a, b, c; int shift = (1 << 6) - 1; s = s & shift; c = s >> 4; s -= c << 4; b = s >> 2; s -= b << 2; a = s; switch (ring) { case 0: switch (a) { case 0x0: return 'a'; case 0x1: return 'd'; case 0x2: return 'c'; case 0x3: return 'b'; } break; case 1: switch (b) { case 0x0: return 'i'; case 0x1: return 'l'; case 0x2: return 'k'; case 0x3: return 'j'; } break; case 2: switch (c) { case 0x0: return 'p'; case 0x1: return 's'; case 0x2: return 'r'; case 0x3: return 'q'; } break; } return 0; } Edited January 19, 2014 by Toph 1
Swizzbeat Posted January 19, 2014 Posted January 19, 2014 First time I've ever seen bitwise operators used O_o
ashleyg48 Posted February 16, 2014 Posted February 16, 2014 (edited) Look's brill o.O - If you don't mind my curiosity... What kind of operator is >> (I've not learnt anything like this before :3) Edited February 16, 2014 by ashleyg48
TheScrub Posted February 16, 2014 Posted February 16, 2014 Look's brill o.O - If you don't mind my curiosity... What kind of operator is >> (I've not learnt anything like this before :3) there called bitwise operations >> right shift << left shift
Allen Posted February 16, 2014 Posted February 16, 2014 Look's brill o.O - If you don't mind my curiosity... What kind of operator is >> (I've not learnt anything like this before :3) You most likely wont use them often if you're planning on programming osbot scripts only :p OT: nice contribution!