petar113507
Full Member
Damn Straight. I Am the king of waffelagia.
Posts: 166
|
Post by petar113507 on Oct 19, 2005 13:46:24 GMT -5
here goes. I now remember what I wanted to know with this : When you use GetPixelColor : do you end up with default if you do $Pix = GetPixelColor( 720 , 567 ) MsgBox( 0 , "Title (W/e)" , $pix ) Does this display a default of decimal value, representing a color, or what? (I'm at school, and I can't compare the EXE files. Now is the time for me to be thinking of the programs, and then work it out at home.) Appreciate thehelp tiny. I think I already knew that already.
|
|
petar113507
Full Member
Damn Straight. I Am the king of waffelagia.
Posts: 166
|
Post by petar113507 on Oct 19, 2005 13:50:46 GMT -5
Oh si~ I realised that about windower as well. that's a pretty kickass program. I think for my resolution I set it to be on my home computer, it's around 74 Pixels. (Less than 100, YES) With that kind of pixel set, would one tap of the keyboard mess with the pixels, depending on fish or skill? Or would it be better to Execute this with more pixels, at a higher resolution. (Oh tiny, I did part of the program last night. It sorta worked, but I hope it doesnt really slow down as the program progresses. Would it?) What I meant to say: Would one opposit direction make the pixel perhaps make the Fishstamina go -1 Pixel? Hmm... well I was typing somehting about using a loop, and an IF statement encased in it.... but I fuigured it would be better to use GoTo. Is there a moer effient way to do this? like.... $pixel74 = ; Decimal Red ; IF Pixel74 = ; Decimal Red ; send( "{NUMPAD 4}" ) IF $Pixel74 = ; Decimal red ; Send( "{NUMPAD 6}" ) Send( "{NUMPAD 6}" ) Send( "{NUMPAD 6}" ) Send( "{NUMPAD 6}" ) goto ..... I don't know how make the GoTo to go to the top of my IF statement chain. How would I make this possible?
|
|
|
Post by TinyTerror on Oct 19, 2005 13:54:58 GMT -5
Yeah, pixelgetcolor returns the decimal representation of the color. The result would be somewhere between 0 and 16777216 or something. This can then be converted to hex in order to get individual color levels. This is a list of all the functions supported by the latest version of autoit. If you have a question about what a function does, takes as arguments, or returns, check this list first. Its good stuff. www.autoitscript.com/autoit3/docs/functions.htm
|
|
|
Post by TinyTerror on Oct 19, 2005 14:00:40 GMT -5
I don't do much fishing at all, so I really can't say much on the subject. I just did enough to figure out a way to get around the new system Part of what makes script writing fun is the challenge of trying to get it working by trial and error. I don't have all of the answers on how to do what you want. You are going to have to sit down and get your own pixel coords and test your own response times, because I don't have that info. Once you figure out how it all works, let everyone know! And no, adding more code won't slow things down. Its what you do with the code that determines speed. Tight unregulated loops will make the game run slowly, but the same loop with a sleep statement or two will run as smooth as glass. You'll figure it out.
|
|
petar113507
Full Member
Damn Straight. I Am the king of waffelagia.
Posts: 166
|
Post by petar113507 on Oct 19, 2005 14:38:32 GMT -5
This means I can stick, just with decimal though? to compare with... so I can use the decimal code to say
IF $Pixel74 = 1354 (Execute something)
that would work right, correct?
|
|
|
Post by TinyTerror on Oct 19, 2005 14:52:38 GMT -5
You can use specific pixel values to check to see if a pixel matches ONLY if the pixel doesnt have any transparency. If it is even slightly transparent, the color will be changed by the background and comparing it to a specific value will be useless. Thats why I talk about checking red levels. Unless you are standing in front of something with a whole lot of red in it (not too common), the part of the stamina bar that shows the remaining life for the fish will have a much higher red level than the part that doesn't. Checking color levels sorta gets around the whole transparent status bar problem.
I'm pretty sure SE made the fishing status bar a little bit transparent just to throw off pixel based methods. It might not look very transparent, but it only needs to be a little less than 0.25% transparent to mess up pixel matching.
|
|
petar113507
Full Member
Damn Straight. I Am the king of waffelagia.
Posts: 166
|
Post by petar113507 on Oct 19, 2005 15:05:36 GMT -5
Ouch..... So the $redlevel thing you said before.... .... Wait! Would the transparency have a differnet effect, to change the overall color? Because using AutoIT Window Info, I think I could have gotten the right string of information... Anywho, we could get another guy on theese forums. He's a firend of mine, he say my bot and he wants to learn. I don't know how committed he is, but I think he'll give it a shot. I'll post of how the bot works... If I finish programming all of it tonight. It takes a long time to pick out onna these things.
|
|
|
Post by TinyTerror on Oct 19, 2005 15:16:19 GMT -5
Yeah, the transparency changes the color of the pixel, because the color of the stamina bar mixes a bit with the color of whatever is behind it, making exact matching with a specific color value impossible. Thats why you check the red level. If there is more than a certain ammount of red in the pixel, its part of the stamina. If there is less, its part of the empty stamina bar. By figuring out when the stamina pixels end and the empty bar pixels begin, we can calculate the remaining stamina of the fish. If you do this repeatedly over time, you can see if the stamina is going up or down, and try to move your rod accordingly.
Pixel based fishing bots with the new fishing system are not impossible, just a bit tricky to get right.
|
|
|
Post by DarkAquaus on Oct 19, 2005 16:45:13 GMT -5
In stead of doing a red lvl a shade check would work in this case too just make a script to dump the pix to a file i thought this might come in handy Func PixelGetRGB($x, $y) $hex = Hex(PixelGetColor($x, $y), 6) $r = Dec(StringRight($hex, 2)) & "|" $g = Dec(StringMid($hex, 3,2)) & "|" $b = Dec(StringLeft($hex, 2)) Return StringSplit($r & $g & $b, "|") EndFunc DIR on shade lvl 101 add red green and blue together now you have a number between 0-765 were 0 is true black and 765 is true white everything else is a shade between that darker red does show in a 10 shade dif vs the background (greater than 500) if i remember that red would be less than 350 but dont quote me on it i didnt run my own checks I made a mp check script using shades only it check for the numbers not the shade of the bar if u want to see how shades work i used a simular prosess in my text reader because that text is 95% transpant x.x big pain in my arse but anyway i did it so my friend claims... I was sitting in a restaunt drinking coffee then it hit me x.x ... on what i did wrong with the script etc etc lol what i was thinking is to speed up the pix check have the script follow the bar instead of grabbing all of it several times basicly have it check 7 pix then based on how it moves is the next 7 pix it grabs but it does a 4 red/3gray 0-74 so it would do 67-74 from the start to get it to move to begin with it wound atempt one way then the other randomly then when it got it to move then it could control the situwation I'd love to help but Im working on a higher paying bot >.> we're talking a 10m+ month... if i get it coded hehe like i said in my last post it uses ffxi ingame clock only it computes the time using a javascript i found on the web with my text reader
|
|
petar113507
Full Member
Damn Straight. I Am the king of waffelagia.
Posts: 166
|
Post by petar113507 on Oct 19, 2005 22:24:11 GMT -5
Okay.... Made the longest script of my life.... which is sad considering it's been only 15 years... >.> Anywho, made this one. Seems to work I think. SO LONG! it's like 929 lines. (I hope this dosent slow like I said tiny....) Anywho, I tried to grasp at what you guys are saying about the Redlevels, and for once, I just looked, and It made sense! Just I don;t know how to derive redlevels in a pixel like you said..... Any commands? I looked at the function thing you said tiny, and the closes thing I could come to it is "ColorMode" it said this: Sets the way colors are defined, either RGB or BGR. RGB is the default but in previous versions of AutoIt (pre 3.0.102) BGR was the default: 0 = Colors are defined as RGB (0xRRGGBB) (default) 1 = Colors are defined as BGR (0xBBGGRR) (the mode used in older versions of AutoIt) I get that I can set it, but I don't know how to call on that when I'm done. Or make my own function out of that little nifty sucker. >< I can make a basic, unefficent bot... I'm going to test it right now. Wish me luck.
|
|
Rzn
Junior Member
Posts: 55
|
Post by Rzn on Oct 19, 2005 22:29:09 GMT -5
This is my fight code its not for autoit but you could make it work eather reading the ffact debug or in autoterror
if $ffact_PlayerStatus = 38 setconst $endfish = 0 SetActiveWindow $window delay 1 sec while $ffact_TargetHpPercent <> 0 and $ffact_PlayerStatus <> 43 setconst $lasthp = $ffact_TargetHpPercent setconst $curkey = d Keydown $curkey 50 delay 50 if $ffact_TargetHpPercent < $lasthp setconst $flag = 1 keydown $curkey 200 while $lasthp > $ffact_TargetHpPercent setconst $lasthp = $ffact_TargetHpPercent keydown $curkey 50 end
not complet but you get the idea
|
|
|
Post by TinyTerror on Oct 19, 2005 22:32:56 GMT -5
DarkAquaus, the partial bar check sounds like a REALLY good idea. It would speed up the script a whole lot. And jesus petar, what are you doing in 900+ lines of code? Did you not use loops or something? Seriously, you could do this in less than 100 lines no problem. While big scripts dont slow down, they do use a lot of memory. Try to keep them small and simple. I think you need to take another look at loops.
|
|
petar113507
Full Member
Damn Straight. I Am the king of waffelagia.
Posts: 166
|
Post by petar113507 on Oct 19, 2005 22:49:16 GMT -5
DarkAquaus, the partial bar check sounds like a REALLY good idea. It would speed up the script a whole lot. And jesus petar, what are you doing in 900+ lines of code? Did you not use loops or something? Seriously, you could do this in less than 100 lines no problem. While big scripts dont slow down, they do use a lot of memory. Try to keep them small and simple. I think you need to take another look at loops. I did use loops.... Just I don't think I did it right... >.> Anywho. I read somewhere GM's Can't PWN you when you use just that part of reel in script. NEways.... Yeah, like I said.... I tried it the initial way I wanted to... and I fuigured that I could do it the way I thought it to be. Identify all pixels.. then fight the fish... I think I can reduce it By like.... Umm... 600 lines.... Which I just did. I added my Own functions... Yeah... I think its still kind of bad, but methinks I need a different approach. Like I said before, I Understand what you guys are saying, just I don't think I could replicate it, not at least the manner, or quality you guys do. Heh, first script though, even if It's bad, I didn';t have to do a skillup Magic bot like I thought I might have to.... Kickass. Keep this bot for memories sake, and start from scratch. I'm embarassed to post this bot. When I nail one under 100 lines, It'll be posted. I'll check out the RBG thing. Just which command is it related to? (Command name, and I'll do my homework for this Script. It's almost addicting. )
|
|
|
Post by TinyTerror on Oct 19, 2005 22:55:18 GMT -5
Post it and we will tell you how to do it better
|
|
petar113507
Full Member
Damn Straight. I Am the king of waffelagia.
Posts: 166
|
Post by petar113507 on Oct 19, 2005 23:00:03 GMT -5
Osheet..... I'll mod it one last time.... I will get to it ASAP. Look for it within several hours, if not, I have to study for history, and will try to post it in the morning, or during school. Edit: Posted it. There we go. It fights the fish for me, using a macros I have Out of game, and I use FFXI windower, so I'm pretty sure it uses Waay different pixels.
|
|