PDA

View Full Version : Pictures / Strings



KuJi
11-08-2006, 10:56 PM
How does Picture -> String work?

Does it look through transparency.. or does anyone care to explain?

Ransom
11-09-2006, 12:50 AM
I'm assuming that you took a screenshot and now want to use it as a string in a script?

The reason you would need to do this is to cut down on the number or bitmaps you have laying around or to release the script to the mass public without having to include pics. What it does is take a bitmap picture and convert it into ascii text (hex code) that is translated back into a bitmap when the time becomes necessary.

Scar looks at a bitmap and if any color is exactly black, meaning 0 red, 0 blue, 0 green, and 0 lightness, then it will look past it and ignore that it is there. So lets say i had a wall filled with windows. You wanted it find the nearest window to you wherever you are standing. If you used a regular bitmap of one of the windows at random the chances you could find it again would be slim because of the stuff that's beyond the window coming through. All the colors behind the window would need to be exact too. But if you BLACK out the stuff in the window and just leave the frames and panes you could find lots of windows. Then when you convert picture -> string it would keep that information there and forget whatever was black.

Now technically this wouldn't work because of perpective and whatnot but this is just one example of why you would need to use transparencies and why you would want to use strings instead of bitmaps.

Hope this helps, keep asking if it doesn't!

Ransom

KuJi
11-09-2006, 05:30 AM
I'm assuming that you took a screenshot and now want to use it as a string in a script?

The reason you would need to do this is to cut down on the number or bitmaps you have laying around or to release the script to the mass public without having to include pics. What it does is take a bitmap picture and convert it into ascii text (hex code) that is translated back into a bitmap when the time becomes necessary.

Scar looks at a bitmap and if any color is exactly black, meaning 0 red, 0 blue, 0 green, and 0 lightness, then it will look past it and ignore that it is there. So lets say i had a wall filled with windows. You wanted it find the nearest window to you wherever you are standing. If you used a regular bitmap of one of the windows at random the chances you could find it again would be slim because of the stuff that's beyond the window coming through. All the colors behind the window would need to be exact too. But if you BLACK out the stuff in the window and just leave the frames and panes you could find lots of windows. Then when you convert picture -> string it would keep that information there and forget whatever was black.

Now technically this wouldn't work because of perpective and whatnot but this is just one example of why you would need to use transparencies and why you would want to use strings instead of bitmaps.

Hope this helps, keep asking if it doesn't!

Ransom

Alright, so black is automatically considered "transparent"? Good enough.

Next Question: What is the best way to pick an item off the ground?

Boreas
11-09-2006, 05:46 AM
Trickier. Best bet would be to get close by clicking on red dot on minimap and then combo of techniques.

KuJi
11-09-2006, 05:53 AM
Trickier. Best bet would be to get close by clicking on red dot on minimap and then combo of techniques.

Well, my script doesn't do a lot of moving. Infact, it only moves when it goes to pickup items.

Only thing is I can't seem to get it to pick up the correct item (a bone), because it sometimes clicks cows etc.. =1

Currently using findcolortolerance - but yeah..

Boreas
11-09-2006, 06:01 AM
I am assuming you are using color, and the color is found in the cow. Try to find a more unique color or dtm. However, not too unique so that sometimes it doesn't work. It's better to have too many false positives than to miss bones. This is because you can check whether it's a false postive with uptext. That's why I said combo of techniques. I believe I saw a bone picker with DTM and text, not sure though, try looking around for it. Also look at Object.scar.

KuJi
11-09-2006, 06:03 AM
I am assuming you are using color, and the color is found in the cow. Try to find a more unique color or dtm. However, not too unique so that sometimes it doesn't work. It's better to have too many false positives than to miss bones. This is because you can check whether it's a false postive with uptext. That's why I said combo of techniques. I believe I saw a bone picker with DTM and text, not sure though, try looking around for it.

Mine check's for the uptext, but it sticks to the monster.

I seen a bone burier, but I received compile errors and don't feel like going through it at the moment.

Do items on the ground change colors through login, or no?

Ransom
11-10-2006, 07:54 PM
I would suggest making an array of DTM's that you can scroll through while looking for bones. (might lag a bit...any other suggestions?) When it's time to pick up bones make sure that you ignore monsters. Only look for bones. Make sure that if a DTM happens to match a monster that it checks the text to say bones. The hard part will be getting enough DTM's or tolerance to make sure to find most if not all bones. It's quite easy with uptext to make sure you don't click on monsters. A script sample would be great!