![]() |
Set Color From Hue Picker - Printable Version +- SphereCommunity (https://forum.spherecommunity.net) +-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d) +--- Forum: Script Submissions (/Forum-Script-Submissions) +--- Thread: Set Color From Hue Picker (/Thread-Set-Color-From-Hue-Picker) |
Set Color From Hue Picker - Avatar - 01-01-2014 02:06 AM I saw some post about how to select manually hue from gump menu to set color to anything in the game. So, actually i shared this before or maybe anyone could share this one before. Since i did not see any related stuff, i decided to post in script submission to make it more clear for those who are looking for. First of all, what we are wanting is only possible with packet filtering. Therefore, we should set packet in sphere.ini like the following ; PHP Code: PACKET149=f_hue_picker After that we should create the function which is going to filter coming packet ; PHP Code: [FUNCTION f_hue_picker] After that, we should define what packet we are going to send client to get hue picker ; PHP Code: [FUNCTION HuePicker] In fact, there is something weird on this if you do realize. SendPacket works with objects and the things that we are looking for is not an object or could it be an object ? Of course, you can for example pick color for character body or hair , etc. Therefore, if we want to get picked hue we should send any object ( it can be layer of anything or whatever you like) to filter hue like the following ; PHP Code: [FUNCTION HuePicker] So the main function to set color to character properties is the function just above. The usage of the huepicker function can be for instance; PHP Code: HuePicker <FINDLAYER.LAYER_HAIR> Let say, you want to use separately for setting color of an object or chat or whatever it is. So, why don't we make it with sending string to function like ; PHP Code: HuePicker <FINDLAYER.LAYER_HAIR>,CHAT Let say we are send chat in argv[1] and argv[0] is the object. Otherwise just send anything unrelated to conditional statement. Hence, we should adjust a little bit our function like ; PHP Code: [FUNCTION HuePicker] Once you send a packet while filtering we can understand whether the purpose of using this function is for CHAT or an object. So, in filtering, make the following changes; PHP Code: [FUNCTION f_hue_picker] I hope this introduction will be helpful for those who do not know or not familier with this. RE: Set Color From Hue Picker - darksun84 - 01-01-2014 03:25 AM nice ![]() |