# Using Filters This is a simple tutorial for all those who didn't understand the command list. Here I'll show you some basic techniques on how to create filters. The examples will be dull, but you'll get the picture alright. The first thing you'll want to do is creating a filter, how obvious! Let's say we want to change a cactus to a 'Violet Smoke Machine'. And then change a yellow sticky to a red one. First we'll need to know what to search for, in this case the sprite of the cactus. The cactus' sprite is 'plant_small_cactus'. The thing we want to replace it with is the sprite of the Smoke Machine, which is 'scifirocket*9'. The command to create/set a filter is :set_filter , , , We've got the search and the replace field, but what about the other two? I'm sure you're familiar with WPE PRO, when you open that you see a list of 'Filter 1' 'Filter 2' 'Filter 3' 'Filter..' and so on. It's basically the position of the filter, also known as the ID. Each filter has a unique ID. WPE limits you to only 40 filters, in Scriptwise you can have just as many as you like. So let's start of by filling up filter 0, which is actually the first. Counting starts as 0, 1, 2, 3, and so on. The field can be anything you like. But it's helpful to name it after what it does. So for example, 'cactus2smoke' or 'Cactus->SmokeMachine', whatever. Now we fill it all in. To pass the search and replacement argument, we'll use the special :terminal argument. Which takes your hexadecimal input from the console. (The console is the big black box you saw when opening Scriptwise, and should still be open. Don't close it, or the browser will crash. The words 'terminal' and 'console' actually mean the same, I might use both.) You can try this out by saying :notice :terminal Then swap over to the console, and enter this hexadecimal value seperated by spaces: 48 65 6C 6C 6F You should see a message popping up on habbo saying 'Hello'. That's because the hexadecimal is the hex representation of the string 'Hello'. Easy, right? By the way, we're using the special :terminal argument because with the long sprites, we probably wouldn't be able to fit it all in one habbo message. So go and type: :set_filter 0, cactus->smoke, :terminal, :terminal Then switch over to the console and you'll be asked for the first hexadecimal input. The first :terminal is for the search string, which was 'plant_small_cactus'. Convert it to hex and you get: 70 6C 61 6E 74 5F 73 6D 61 6C 6C 5F 63 61 63 74 75 73 Type this in the console and hit enter. Then you'll be asked to enter another hexadecimal input, which ofcourse is the replacement string. The replacement string was 'scifirocket*9', in hexadecimal this would be: 73 63 69 66 69 72 6F 63 6B 65 74 2A 39 Enter it on the console and hit enter. When you now look at habbo, a message should appear saying your filter was set. By the way, if you wouldn't use the special :terminal argument, your command would look like this: :set_filter 0, cactus->smoke, plant_small_cactus, scifirocket*9 Now that we have set the filter, we must enable it! Try the command :get_filters This shows a list of all filters and their corresponding ID. As you can see, it shows 0 (Off) == cactus->smoke Click 'OK' to close the notice. Now we will enable the filter. The command you use for this is :toggle_filter This command is used for enabling and disabling filters. The field speaks for itself. Remember what ID the cactus->smoke filter was? Right, 0. So we go: :toggle_filter 0 You should see a notice saying it's now enabled. WOOHOO!!!!11~~! Go find yourself a nice cactus and move it to see it change into a Violet Smoke Machine. To disable it, toggle it again with the same command. It should now say it's disabled. Now we'll move on to the sticky. We want to change a yellow sticky to a red one. Make sure you have rights in the room of the sticky you want to change. The color we'll be searching for is yellow. In RGB color this would be FFFF33. Red is FF0000. That's what we'll be replacing yellow with. Since ID 0 is used already, we'll have to use another one, like 1. Enter this: :set_filter 1, sticky yellow->red, FFFF33, FF0000 :toggle_filter 1 And it should be all done! However, don't be fooled by the hex value you just entered in habbo. If you were to use the terminal for this one, you did: :set_filter 1, sticky yellow->red, :terminal, :terminal Then on the terminal you entered: 46 46 46 46 33 33 and 46 46 30 30 30 30 Once the filter is enabled, open up a sticky and edit the text. Then close it and turn off your filter. Reload the room and you should see the sticky is still red. Now we're going to make a dummy filter. We'll be replacing 'aaaa' with 'bbbb'. I chose these strings so your habbo won't crash. So, we do this: :set_filter 2, Dummy, aaaa, bbbb You'll get a message saying the filter is set, etc etc. Right now I want to show you some mass toggling. Say you've created a bunch of filters and you want to toggle them all at the same time, what would you do? You can type out every command, but it would take ages, so there's a solution for that. :toggle_filter :0-2 The : means the current argument is special, 0-2 is the range of filters you want to toggle. All filters between 0 and 2 will now change status. You could also do: :toggle_filter 0, 1, 2 or :toggle_filter 1, 5, 7, 10 or even :toggle_filter 0, :5-10, 12, 14, :16-20 The filter will only be toggled if it is defined, ofcourse. Now on to removing a filter from your current list. You decide you don't need the dummy filter anymore, now what? We use the command: :rem_filter Notice that the 'rem' stands for 'remove'. And the dummies ID was 2. So we type: :rem_filter 2 And the filter is gone. This command also works with: :rem_filter 1, 3, :5-10 etc etc. Just be careful you don't lose any precious data. Try: :get_filters To see the status of your filters, which are defined and which are not, and what ID is set to what filter. If you understand until now, that's good, but you're not there. We still have to discuss saving your filters to a file, and loading them back in to scriptwise. Say you've made a bunch of filters but you got to close Scriptwise, damn! But no worries, you can easily save them. :save_filter , , [ comment ] Not that the [ comment ] field is optional. You fill in with the name of your filter. Like 'UBER 1337'. The is your own (nick)name. So I want to save all 3 filters I made, cactus->smoke sticky yellow->red Dummy I just type: :save_filter UBER 1337, Mitch, This is a test filter. Because the last argument is optional, I could've said: :save_filter UBER 1337, Mitch instead. Your filter now is saved safely inside the .\flt\ directory of your Scriptwise. It should look like: .\flt\UBER 1337.hsf The .hsf extension shows it's compatible with Scriptwise. Now we restart Scriptwise and enter a room. All filters should be reset, and we load up the 1337 filter. :load_filter Remember the name of the filter? UBER 1337 Don't mind the .hsf extension it was saved with, just type: :load_filter UBER 1337 and you've got your filters back. :get_filters for proof.