bitshifting << or >> is only use when you want to squeeze all numeric information into 1 single variable
signed int is initialize as -2^31 ~ 2^31-1
so it can save 31 bits
so let's say I want to save player's base level, job level, and job ID in 1 single variable
assume that max base level is 255, max job level is 120, max job ID is Job_Rebellion(4215)
make baselevel use 8 bits = 2^8 (256)
make joblevel use 7 bits = 2^7 (128)
make job ID use 13 bits = 2^13 (8192)
total used = 28 bits, still has some space
and the script looks like this
prontera,155,185,5 script kdsfksdf 1_F_MARIA,{ // save the data as .@data = BaseLevel << 0 | JobLevel << 8 | Class << (8+7); dispbottom "data = "+ .@data; // retrieve the data as dispbottom "baselevel = "+( ( .@data >> 0 ) & ( ( 1 << 8 ) -1 ) ); dispbottom "joblevel = "+( ( .@data >> 8 ) & ( ( 1 << 7 ) -1 ) ); dispbottom "job ID = "+( ( .@data >> (8+7) ) & ( ( 1 << 13 ) -1 ) ); end;}.yeah this stuff is totally useless since we know how to use query_sql
its better to save all these stuff into sql table, because sql has better readability, and website also can list them etc.