Log in

View Full Version : Reflection or color?



Dogma
03-05-2011, 01:07 AM
So I discovered villavu about three weeks ago and Ive been using simba with YoHojo's p.m.s and DOOMS vwm with great results. I've tested about a dozen scripts, and I found that only the aforementioned two suited my needs. Therefore, I've decided that I want to learn how to scipt. Not only will I be able to tailor the script to my liking, but I get to give back to the community that's helped my rs endeavors enormously.

However, before I start I'd like a couple base questions answered. (Not sure if they are in the faq section, because faq does not work for me atm.). Firstly, how long does the script learning process take on average? Obviously, mileage does vary, but how long after learning did (you) pump out your first script? Secondly, should I learn/use color or reflection. I understand the premise of ''color'' but I have no idea wtf reflection is or how it works. Thirdly, what guide do you recommend I follow? I've loads of 'em, most f which have 5 stars.

Thanks,
Dogma

Iamadam
03-05-2011, 01:14 AM
1. Can take a few weeks to many months. Depends how inclined you are towards logic, and how much effort you put in. I made my first script within about 2 weeks of finding scar. It was simple but it worked.
2. Really depends. In this community, color is preferred as it isn't as easily broken - but it is quite a bit more difficult to use. With reflection it is very easy to write a script which will run for hours. I'd suggest to use them both together.
3. The best way to learn is to modify the scripts of others, but definitely read a guide too. Look for a guide that gives examples the whole way through.

Really great to see new people keen to learn!

Frement
03-05-2011, 01:17 AM
Reflection:
- Easy to learn
- Easy to script with
- Reliable, doesn't need so much failsafes

Color:
- Takes longer to learn
- Harder to script reliable code
- Usually isn't that accurate, unless used correctly

Personal thoughts:
- I always prefer color, just because in reflection, hooks need to be updated (they get updated pretty fast, but still), and its just too simple, takes away the challenge.
- Reflection is more effective then color, thought color can reach the same level as reflection.

Flight
03-05-2011, 01:24 AM
1. blah.
2....I'd suggest to use them both together...
3. stuff.

Really great to see new people keen to learn!

You should check out my LandScorcher script if you'd like an example on how to use Reflection and color together for finding trees, it's a smart combination of how I did it.

Dogma
03-05-2011, 01:25 AM
Thanks for the prompt replies! Seems like I have some ''homework'' to do on the subject. So far I think I'm going to start with reflection and work my way ''up'' to color. Be on the lookout for my Varrock clay softener :)

PatDuffy
03-05-2011, 01:26 AM
Firstly, how long does the script learning process take on average?

The learning process does vary greatly, as Iamadam stated. I am new to scripting myself and learned enough to create a stable multi-tree woodcutter after around a month of learning and experimenting with scripts. From what I have seen, one can never stop learning how to optimize and increase the efficiency of a script.



Secondly, should I learn/use color or reflection. I understand the premise of ''color'' but I have no idea wtf reflection is or how it works.

I would suggest that you learn both, and use one as a failsafe. Reflection is a type of style that uses information collected from S.M.A.R.T. for use in scripting(correct me if this isn't accurate). The reason that most of the community prefers color scripts is that without color, Runescape would not exist, and since Reflection can become broken at any time color is more stable. Reflection is easier to script with once you learn how, so I suggest reading beginner's tutorials in the Reflection section, as well as in Tutorials For Beginners.



Thirdly, what guide do you recommend I follow? I've loads of 'em, most f which have 5 stars.

Each guide has a different focus, so using as many as possible is probably the best idea. To begin with I would check Here for very basic information (http://villavu.com/forum/showthread.php?t=58935), Here for the Basic of scripting with Runescape (http://villavu.com/forum/showthread.php?t=12154), and Here to learn about Colors (http://villavu.com/forum/showthread.php?t=41924)


We're always glad to see someone eager to learn how to script to give back :D

Dogma
03-05-2011, 01:59 AM
One more quick question. Is it a different procedure for scripting with scar or simba? Can what's learned in a scar tutorial be applied for simba too?

Iamadam
03-05-2011, 02:11 AM
One more quick question. Is it a different procedure for scripting with scar or simba? Can what's learned in a scar tutorial be applied for simba too?

A few tiny differences, but pretty much the same. They both use pascal script.

Flight
03-05-2011, 02:17 AM
I think 90% of using the two will be the same, but IMO I think Simba is all-around simpler to learn and work with, that's what I've been using to learn to script, I'm very new myself.

Coh3n
03-05-2011, 05:08 AM
It depends what you're looking for. If you want to challenge yourself, learn to think critically, and problem solve, then learn color. If you just want to write working scripts fast, then learn reflection. You can still learn to think critically and problem solve with reflection, just on a lesser scale.

For some Simba basics, you can visit my tutorial (http://villavu.com/forum/showthread.php?t=58935). I recommend going through it regardless of whether you learn reflection or color, it will help you with both.

PatDuffy
03-05-2011, 05:27 AM
It depends what you're looking for. If you want to challenge yourself, learn to think critically, and problem solve, then learn color. If you just want to write working scripts fast, then learn reflection. You can still learn to think critically and problem solve with reflection, just on a lesser scale.

For some Simba basics, you can visit my tutorial (http://villavu.com/forum/showthread.php?t=58935). I recommend going through it regardless of whether you learn reflection or color, it will help you with both.

Haha, thats actually the same tutorial I started out with, and recommended for him up above:p

Coh3n
03-05-2011, 05:29 AM
Haha, thats actually the same tutorial I started out with, and recommended for him up above:p
Good to know people are using it and yeah I didn't bother to read everyone else's responses. :p

Boreas
03-05-2011, 06:00 AM
Reflection and color are similar in some ways. They both can be used well. They both can be used poorly. Everything in RS has an ID and an appearance, which can be changed at jagex's will; reflection and color can each only see one of those two attributes.

Wanted
03-05-2011, 06:21 AM
Not to mention if reflection goes down, all your work is worthless until it's back online..

It's been unavailable in this community for years at a time before.

Iamadam
03-05-2011, 06:34 AM
Not to mention if reflection goes down, all your work is worthless until it's back online..

It's been unavailable in this community for years at a time before.

[shameless plug]...but now that there's an open updater being worked on it won't happen again... and everyone who knows java should help out (see link in my sig)[/shameless plug]

Wanted
03-05-2011, 06:42 AM
[shameless plug]...but now that there's an open updater being worked on it won't happen again... and everyone who knows java should help out (see link in my sig)[/shameless plug]

That's great and everything but what you don't know is it's more than just hooks that go into reflection.

The information you get is in raw form and has to put into algorithms in order for it to be usable.

Take TileToMS for example. It was 18 months from the time of reflection dying because of RuneTek5 to when it started working again.

Iamadam
03-05-2011, 06:46 AM
That's great and everything but what you don't know is it's more than just hooks that go into reflection.

The information you get is in raw form and has to put into algorithms in order for it to be usable.

Take TileToMS for example. It was 18 months from the time of reflection dying because of RuneTek5 to when it started working again.

I know, it was more of a shameless plug :P But it really isn't that hard to figure things like TileToMS out. Its just that someone needs to actually do it.

cycrosism
03-05-2011, 06:53 AM
It is great when you combine them to make a hybrid script. I have made a powercutter that uses colour for finding the trees and uses reflection to check if the player is animating or moving.

It works really really well

pyroryan
03-05-2011, 06:53 AM
That's great and everything but what you don't know is it's more than just hooks that go into reflection.

The information you get is in raw form and has to put into algorithms in order for it to be usable.

Take TileToMS for example. It was 18 months from the time of reflection dying because of RuneTek5 to when it started working again.

Probably because no one actually looks at how the client works? Obviously identifying stuff is hard, no doubt about it. But a lot of people nowadays don't know what they're hooking, just that they're hooking "something" (which is usually based on what other people have hooked), leading to such complications. Then when their updaters break, they depend on other people to supply the new correct hooks so that they can update their updater because they can't identify the correct hooks/fields themselves. Using what someone else has done is fine, but its when that person stops doing it that it becomes a giant issue because the people left can't actually re-find fields. Suddenly, their loads of updaters becomes useless from lack of maintenance. With that said, I do not know the specifics of finding every hook either, but I know enough that I can manually repair several/most hooks without relying on others.

Wanted
03-05-2011, 06:55 AM
I know, it was more of a shameless plug :P But it really isn't that hard to figure things like TileToMS out. Its just that someone needs to actually do it.

Well it takes more than just people who know java, or people that know a lot of math and/or the pascal script side, it takes people that know both and dedicate time to doing it. Major updates have killed reflection for long periods of time in this community, long enough to kill all scripts that were using it.

If you make a script in color, you can really rely on it working through any major update with negligible adjustments that you can do yourself.

The pros of color far outweigh the cons when compared to reflection, but it's not a two sided coin. There's a plan and method suitable to many different needs.

If you are looking to make a reliable Legends guild yew cutter or a quest runner and especially in a short period of time than reflection may your best bet because it will allow you to reliably get it done fast.

If you are looking into supporting a script in the long run it's in your best interest to write it in color because you will be able to support it longer, this is especially important for large year long projects or payscripts.

If it's a simple script than it's best you just write it in color and have it stable and reliable with out having to rely on anything like reflection.

The most recommended thing for all scripts though is a hybrid system in which the script can run with soley color or soley reflection at any time or both. Anyone perusing in becoming a legend or pushing the bounds of challenge and innovation will consider a fully hybrid system in which reflection or color can be nulled out of a script with defines at any given time in order to allow the script to instantly adjust for any unexpected updates, and for maximum reliability and longevity both during the script run and over the course of the script's public life and appeal.

It's a common misconception that color and reflection is some black and white story when in fact its as complex and dynamic as anything.

pyroryan
03-05-2011, 06:59 AM
I agree with Icefire. Things like ground items are probably better done in reflection. Large scale world walkers are also probably better done in reflection. NPC finding should be done in both (so a RS update related to NPCs can't kill the script and reflection can be used to locate NPCs off the screen).

Iamadam
03-05-2011, 08:35 AM
Agree. ^
Although world walking can be done in color thanks to SPS. :)

And I agree with icefire on using both color and reflection. Not relying on one or the other ensures a script will last for a long time.

pyroryan
03-05-2011, 04:35 PM
Agree. ^
Although world walking can be done in color thanks to SPS. :)

And I agree with icefire on using both color and reflection. Not relying on one or the other ensures a script will last for a long time.

By large-scale, I meant like doors, ladders, stairs, shortcuts, etc. I'd imagine that it'd be significantly harder with color.

Flight
03-05-2011, 04:57 PM
By large-scale, I meant like doors, ladders, stairs, shortcuts, etc. I'd imagine that it'd be significantly harder with color.

Color can generate the same results as far as my knowledge serves me.

Take this as an example, you script runs you through a building with a door that can be closed. Reflection will detect the closed door id and tell the script to open it. Color can detect if the door's color patterns are in within a certain area on the MS, if they're in another area (where they'd appear if the door was closed) then the script could throw the same flag to open the door and continue. (This is assuming your camera set to a certain angle, if not then this wouldn't work)

pyroryan
03-05-2011, 05:39 PM
Color can generate the same results as far as my knowledge serves me.

Take this as an example, you script runs you through a building with a door that can be closed. Reflection will detect the closed door id and tell the script to open it. Color can detect if the door's color patterns are in within a certain area on the MS, if they're in another area (where they'd appear if the door was closed) then the script could throw the same flag to open the door and continue. (This is assuming your camera set to a certain angle, if not then this wouldn't work)

Except theres probably hundreds of different doors, each with a different color.

Train
03-05-2011, 08:06 PM
Except theres probably hundreds of different doors, each with a different color.

Use CTS1, not CTS2, and a high tolerance. :D

pyroryan
03-05-2011, 09:53 PM
Use CTS1, not CTS2, and a high tolerance. :D

But then you'll probably have more misclicks/failed openings. Obviously I know its possible, I'm saying that its harder.

Flight
03-06-2011, 01:19 AM
Yeah it's more difficult, but anything you do with color in the first place has to be done manual, why should that be different? Finding colors and an area the colors are located in takes a matter of minutes.

doom0791
03-06-2011, 10:14 AM
I'd learn both. Reflection is great because it helps sufficiently with detecting locations, etc. and making scripts more accurate. However, a good color script does a great job at both!

It really does take time and effort to really learn to script well. It took me probably 2.5 months to get to a point where I could make an extremely basic script; however, everyone learns differently.

As for a tutorial, most of the ones in the tutorial section should do. Really what you should do is read tutorials on how a script in general works, and then jump right in to messing with it. Make basic report scripts, auto-clickers, etc. and get the feel for how each function / procedure works.


It is great when you combine them to make a hybrid script. I have made a powercutter that uses colour for finding the trees and uses reflection to check if the player is animating or moving.

It works really really well

I actually wouldn't recommend relying on animations. If the tree disappears and you didn't get the last log from it, you continue the animation for 4-7 seconds after - extremely easily detected by Jagex and inefficient.

I use reflection to "watch" ID's and when ID's change I know the tree's gone.

Floor66
03-06-2011, 02:44 PM
Start with colour. Learn TPA's, (D)DTM's, Radial Walking, all the good stuff. Then you could start thinking about using reflection.