Trocar de imagem quando passar o mouse por cima Topic is solved

Tire suas dúvidas sobre programação em AutoHotkey

Moderator: Gio

User avatar
Hologram
Posts: 129
Joined: 06 May 2020, 16:47

Trocar de imagem quando passar o mouse por cima

30 Sep 2020, 10:04

Ao passar o mouse por uma das imagens do meu menu, eu gostaria de expandir um pouco a imagem ( creio que seja necessario trocar), ai ao tirar volta ao normal
Discord: Npc Bugado#9074



local config = {
delrey = getPlayerCarValue(cid, DELREY),
cigarro = getPlayerCancer(cid, DERBY),
prostituta = getPlayerAIDS(cid, cracuda),
tresOitao = getPlayerRevorvi(cid, 38)
}
if(delrey == "Ligado" and cigarro == "Aceso" and prostituta == "No Colo" and tresOitao == "Carregado") then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Começou o fim de semana. #PAS")
end


User avatar
Gio
Posts: 1075
Joined: 30 Sep 2013, 10:54
Location: Brazil

Re: Trocar de imagem quando passar o mouse por cima

30 Sep 2020, 18:09

Boa tarde.

Você pode fazer algo semelhante ao que foi abordado neste tutorial.

O tutorial agrega várias coisas juntas:

1. Mudar o cursor ao passar o mouse sobre o botão
2. Mudar a imagem do botão ao passar o mouse sobre ele
3. Mudar a imagem do botão ao clicar sobre ele
4. Colocar os binários das imagens dentro do próprio script
User avatar
Hologram
Posts: 129
Joined: 06 May 2020, 16:47

Re: Trocar de imagem quando passar o mouse por cima

01 Oct 2020, 08:20

O seu script em si ali funciona legal, mas se eu trocar por qualquer outra imagem, tanto usando seu script pra pegar o código, quanto o HHD Software Hex Editor, ele seta esse erro:
1.png
1.png (5.9 KiB) Viewed 188 times
PS: Retirei todos espaços e quebra de linha
Discord: Npc Bugado#9074



local config = {
delrey = getPlayerCarValue(cid, DELREY),
cigarro = getPlayerCancer(cid, DERBY),
prostituta = getPlayerAIDS(cid, cracuda),
tresOitao = getPlayerRevorvi(cid, 38)
}
if(delrey == "Ligado" and cigarro == "Aceso" and prostituta == "No Colo" and tresOitao == "Carregado") then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Começou o fim de semana. #PAS")
end


User avatar
Gio
Posts: 1075
Joined: 30 Sep 2013, 10:54
Location: Brazil

Re: Trocar de imagem quando passar o mouse por cima

01 Oct 2020, 10:17

Esse erro está basicamente dizendo que faltou as aspas duplas no final da string.

Quando você quer inserir dados literais usando o operador de expressões matemáticas :=, você precisa colocar todos os literais entre aspas duplas.

Code: Select all

Var := "Este texto deve vir entre aspas duplas, ou seja, aspas duplas no começo e aspas duplas no fim"
msgbox % Var
User avatar
Hologram
Posts: 129
Joined: 06 May 2020, 16:47

Re: Trocar de imagem quando passar o mouse por cima

01 Oct 2020, 13:06

Como eu ja havia desconfiado eu tinha colocado entre as aspas duplas sim, nao sei pq a variavel nao ta recebendo, afinal é só texto, será que é por causa do tamanho que ficou o codigo?

Code: Select all

FILE_DATA_ORDINARY_BUTTON_IMAGE := "FFD8FFE000104A46494600010101006000600000FFDB0043000A07070907060A0908090B0B0A0C0F19100F0E0E0F1E161712192420262523202322282D3930282A362B2223324432363B3D4040402630464B453E4A393F403DFFDB0043010B0B0B0F0D0F1D10101D3D2923293D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3DFFC0001108012C011703012200021101031101FFC4001F0000010501010101010100000000000000000102030405060708090A0BFFC400B5100002010303020403050504040000017D01020300041105122131410613516107227114328191A1082342B1C11552D1F02433627282090A161718191A25262728292A3435363738393A434445464748494A535455565758595A636465666768696A737475767778797A838485868788898A92939495969798999AA2A3A4A5A6A7A8A9AAB2B3B4B5B6B7B8B9BAC2C3C4C5C6C7C8C9CAD2D3D4D5D6D7D8D9DAE1E2E3E4E5E6E7E8E9EAF1F2F3F4F5F6F7F8F9FAFFC4001F0100030101010101010101010000000000000102030405060708090A0BFFC400B51100020102040403040705040400010277000102031104052131061241510761711322328108144291A1B1C109233352F0156272D10A162434E125F11718191A262728292A35363738393A434445464748494A535455565758595A636465666768696A737475767778797A82838485868788898A92939495969798999AA2A3A4A5A6A7A8A9AAB2B3B4B5B6B7B8B9BAC2C3C4C5C6C7C8C9CAD2D3D4D5D6D7D8D9DAE2E3E4E5E6E7E8E9EAF2F3F4F5F6F7F8F9FAFFDA000C03010002110311003F00F64A2968A004A28A5A004A29692800A296928016929692800A5A28A004A2968A004A29692800A28A2800A28A28016929692800A5A28A004A28A5A004A29692800A29692800A2968A004A2968A004A2968A002928A2800A28A2800A28A2800A28A28016928A2800A5A4A2800A28AE4FC71E3FB0F06DA057C5C6A32AE61B553CE3FBCC7F857F53DBBE003A1D4F55B1D16C5EF352BA8ADAD93AC921C0CFA0F53EC39AF2BF117C730AEF0F876C0301C7DA6EF383F441CFE67F0AF31F10789353F13EA06F355B932BF3B1070910F455EC3F53DC9ACBA00E9350F887E29D498B4FADDDA03FC36EDE48C7FC0315963C43AC86DC357D4777AFDAA4CFF3ACFA2803A8D37E24F8AF4B6062D6279D7BA5CE2607F16E7F235E85E1CF8E16B70EB0788ACFEC8C78FB4DBE5A3FC57EF0FC335E2B45007D75677B6DA85AC775673C53DBC8329246C19587B1153D7CB7E16F186ABE11BDF3B4D9BF72C7335B3F31CBF51D8FB8E7F957D09E11F19E9BE31D3BCFB16293C7813DB39F9E23FD47A11D7D8E45007434525140051451400B4945140051451400514514005145140051451400B4525140052D251400B49451400B49451400B49451400B452561F8BBC5369E11D0A5BFBAC3BFDC821079964EC3E9DC9EC28032FE20F8F60F06E9CA90ED9B54B853E4424F0A3FBEDFEC8EDEA78F523E75BEBEB9D4EFA6BCBE9DE7B999B749239C963FE7B76A9756D56F35BD527D435094CB733B6E76EDEC00EC00E00AA740051451400514514005145140055ED1B59BDD03538750D36730DC44783D9877561DC1F4AA345007D3DE09F19D9F8CB471730622BA8B0B736E4E4C6DEA3D54F63FD41AE92BE52F0D788AF7C2DAD45A95837CE9F2C9193F2CA87AAB7B1FD0E0D7D37A06BB69E23D1EDF52B07DD0CCB9C1FBC8DDD5BDC1A00D1A5A4A28016928A28016928A280168A4A280168A4A280168A4A280168A4A2800A5A4A28016928A28016928A280169296928023B89E2B5B79679DD6386242EEEC701540C927F0AF99FC79E2F97C61E207B9CBAD94398ED223FC299FBC47F79B193F80ED5DF7C69F181445F0D5949F33624BD607A0EAB1FE3C31F6DBEB5E394005145140051451400514514005145140051451400576DF0C7C6A7C29AE791772634BBC60B364F11374127F43EDF4AE268A00FB04104023907BD2D79A7C1DF18FF6BE92744BD93379629FB9663CC90F41F8AF03E98F7AF4AA005A4A28A005A4A28A005A2928A005A2928A005A2928A005A4A3F0A3F0A0028A3F0A3F0A0028A3F0A3F0A0028A3F0A3F0A005AC7F14F8820F0C787AEF53B8C3792988E3271E6487855FC4FE9935AFF0085782FC65F157F6AF881747B693369A71FDE60F0D31EBFF7C8E3EA5A803CFEF6F27D46FA7BCBB90C9713C86491CF762726A0A3F0A3F0A0028A3F0A3F0A0028A3F0A3F0A0028A3F0A3F0A0028A3F0A3F0A0028A3F0A3F0A0028A3F0A3F0A00BFA16B373E1FD6AD753B33FBEB77DDB7B38FE253EC46457D4DA46A96DAD6956BA8593EEB7B98C4887B8CF63EE0E41FA57C955EB5F047C53E55C4FE1CBA7F964CCF6993D1BF8D07D47CC3E8D401ED14947E147E14005147E147E14005147E147E14005147E147E14005147E145002D252D25001451450014514500145145006178D3C469E16F0BDE6A248F395765BA9FE295B851F8753EC0D7CBB248F2C8F24AE5E4762CCCC79627A93F8D7A47C6AF12FF0068F8862D1EDDF36FA78CC983C199873FF7CAE07D49AF35A0028A28271D481F5A0028AD7D2FC29AEEB414E9DA4DE4E8DD24119543FF00026C0FD6BABB0F829E27BA0AD74D6364A7A89252EC3F05047EB401E7B457A89F84DA1E9C4FF6D78D2CE123AA288D08FF00BE989FD290786FE16D937FA4F89AF2E1875D8FB87FE391FF005A00F2FA2BD408F8470F1FE9F3E3BFEFF9FE549F69F847D3EC17E3DF33FF00F15401E61457A888FE11CFC7997F6E4F7FDFF1FA1A6FFC22FF000C2F8FFA2F8AAEA063D04AE147FE3E83F9D00798515EA3FF000A874BD40FFC493C6165724F442A8E7F357FE9599A87C18F14D982D6E9677A07410CFB4FE4E07F3A00E068AD2D4FC39ACE8BB8EA5A5DE5B28FE39223B3FEFA1C7EB59A0E7A1CD0015634FBFB8D2F51B7BEB37D9716F22C919F7073CFB76AAF45007D63A0EB16FAFE8767A9DA9FDD5CC61C0CFDD3DD4FB8391F8568578E7C0FF12ED92EFC3F70FC366E6DB27BF4751FA363FDEAF63A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A002B2FC4DADC7E1CF0E5F6A9280DF668CB229FE273C2AFE2C40AD4AC8F15787A0F14F87AE34BB891A212E0ACAA325181C838EFC8E47A7A5007CB373712DE5D4B73732192799CC9239EACC4E49FCCD5CD0F41D47C47A8AD96936CD3CE46E6E40545EECC4F0055DF14783B55F08DE08B5283F72E7115CC7CC72FD0F63EC79A97C13E2FB8F06EB7F6C8A3F3A0957CBB8849C6F5CE783D88ED401E83A1FC0940164D7F53666EF0598DA07FC0D864FE0057A068DE07F0F683B4E9FA4DB248BD2575F324FF00BE9B27F2AB9A078874EF12E9A97DA5DC2CB11E187468DBFBAC3B1FF238AD3A00C4F18CD796BE0FD56E34E99A1BA86D9E58E4500952A327AFB035F33DFEBBAAEAA49D4352BCB907B4B3B30FCB38AFAB2F2D92F6CA7B693EE4D1B46DF46183FCEBE479A07B59E482518922631B0F420E0FF2A008C003A002973DA8A2800A28A2800A334514009819CE066B4EC7C4BACE92BFF12FD56F6DC0E76A4EDB7FEF9CE2B36AF687A7FF006AEBDA7586D245CDCC711FA1619FD33401F53E92273A3590BC7325C7D9E3F359BAB36D1B89FC7358FACFC3DF0D6B9B9AEF4A81656FF96D00F29F3EB95C67F1CD748296803C635CF8152A069341D484807482F060FE0EA3F98FC6BCBF54D2AF745D424B1D4AD9EDEE63FBC8D8FC0823823DC57D37E29F16E99E12D3BED3A94BF33E443027324A7D00F4F527815F3878A7C4975E2BD766D4AF15519C048E25E91A0E8A0F7EA493DC934015348D527D1357B4D4AD0E26B59048A33F7B1D54FB1191F8D7D59A6DFC3AA69B6D7D6C730DCC4B2A13D70C322BE6DF08780B56F184C1AD53ECF62A7125E4ABF20F50A3F8CFB0E3D48AFA3745D260D0F46B4D36D4B186D6311A97E49C773EE4F34017A8A28A0028A28A0028A28A0028A28A00334669692800CD19A28A00334668A2800CD14514015EFAC2D753B296D2FA08E7B7946D78E45C822BC27C7FF0B2E3C3824D4747F32E74B1F33A1F9A4B71EFFDE5F7EA3BFAD7BE4B347042F2CD22471A02CCEED80A07524F615E61E20F8D9A7D96A51DBE91686FE047027B82DB1597B88C773EE78E3BE73401E4BE1BF12EA1E16D512FF4D976B749236E5255FEEB0F4F7EA3B57D1FE13F16D878BB495BDB162AEB859E0639685FD0FA8F43DFF315E53E2BF02D86BFA59F13F81F6CD6EF96B8B18C60A1EADB57B11DD3F2F4AE1BC33E25BEF0AEAF1EA1A73FCC3E592363F2CA9DD5BFCF06803EABAF9AFE27E90747F1F6A2A1488AE985D467D43F2DFF008F6EAF7DF0CF896C7C55A345A8D83FCADF2C91B1F9A27EEADEFF00CC60D707F1C3C3E6EB47B4D6A14CBD9BF953103FE59BF427E8D8FF00BEA803C468A28A0028A28A0028A28A002BBCF839A49D47C771DCB2E62B085E6271C6E3F228FAFCC4FE15C1D7BE7C16D04E99E1393529976CDA949E60C8C1F297213F33B8FE22803D16B97F1CF8E6D3C19A66F6C4D7F303F67B6CFDEFF69BD147EBD054FE34F185A783B4637771892E24CADB5B83832BFF00451C64FF0052057CDDAAEAD7FE22D5E4BCBD91EE2F2E180014679E81547A7602801BAC6B37BAEEA32EA1A9DC34D7127566E8076007603D057A37803E11C9A8795A9F89A378AD4FCD1591CABC9EEFFDD5F6EA7BE3BCBA0F8574AF87DA5C7E23F19057D40F3696030C55FA8E3BB8F5E8BF5E9BFE14F8CBA7EAF73F65D6E24D36676C472EFDD0B0CF0198FDD3EE783EDD2803D1A0822B58120B78D228A35DA888A15540E8001D05494060C0104104641068A00334668A2800CD19A28A00334668A2800CD1451400514B494005145140051451F9D00159FAE6BB61E1DD2E4D43539845047C7AB3B76551DC9F4A4D775DB2F0EE9336A3A94BE5C110E839676ECAA3B93FE78AF9B7C5FE30BFF18EAC6EAF0F9702645BDB2B65615FEAC7BB77F60000017FC6DF10B51F18CE6239B5D315BF776AA7EF7FB4E7F88FE83B7AD725451F8D006E784FC5DA878435517762DBE27C09EDD8E1265F7F423B376FA645773E29F09E9FE36D25BC57E0C50666C9BCB151862DD58851D241DC746EA39EBE555B7E13F15DFF00843575BDB16DC8D859E06385993D0FA11D8F6FA645004BE0CF17DDF83B5A5BCB7CC96D2616E6DF3C4A9FD18763F87426BE8D8A6D37C5FE1C2D1B2DC69F7F0952477523047B107F222BC93C69E14B1F1568FF00F098F84577AC80B5EDAA8F9830FBCDB47471FC43BFDE1EF89F0D3C78DE13D53ECB78E4E9374E3CDEFE4B74F307E99F6FA500737E22D0AE7C37AEDD6997609781B0AF8E2443CAB0FA8FEBE95995F457C46F0347E33D212EAC0C7FDA76E99B770462643CEC27D0F507B1F626BE789E096DA79209E378A68D8A3A38C32B0EA08EC68019451F8D1F8D001451F8D496D6D35E5CC56D6B13CD3CAC1238D065989E800A00D5F0A78726F15788ADB4C8370473BA7907FCB3887DE6FE83DC8AFA4359D634EF077875AEAE008AD2D51638624EAC40C2A28F5E3F219E82B07C09E12B5F00786E7BAD4A58D6EE44F36F2727E58D40CEC07D07EA7F0AF1DF1E78CEE3C67AD99143A58424A5A407A81FDE23FBCDC7D381F500CDF10EBFA878B75E7BDBBDD24D2B08E186304845CFCB1A0FC7F12735E8BA2687A6FC2CD153C41E2455B8D726522D2CD4826338E83DF9F99FA0E8339E53C39A1D87C33D08789BC4D1F99ABCC0AD9D9F1B9091D07A363EF37F08E3AF07CDB5FD7EFBC4DABCBA8EA52EF99F8551F7635ECAA3B01FE24F268017C43E21D43C4FAB49A86A72EF95B8545E1225ECAA3B01FAF53CD6651F8D1F8D00775E03F89D7BE1678ECAFCC977A4E71B3ABC1EE87D3FD93C7A62BDF74ED4AD356B18AF2C2749EDA65DC9227423FA1F507915F247E35D57817C7577E0DD4B8DF3E9B3303716C0FF00E3E9E8C3F5E87B1001F4BD155B4ED46D755B082F6C6659EDA750F1C8BD08FF001F51DAACD001451450014514500145145002D251450014514500151DC5C43696F2CF7122C70C485DDD8E02A81924FE15213C578CFC66F1A1965FF846EC24F91086BD653F79BAAC7F8704FBE0763401C7FC40F1B4DE31D68B465A3D36DC95B588FA7776FF0068FE8303D73CA514500145149B97D47E7400B4526E5F51F9D1B97D47E7401D2F823C6977E0DD5C4F18696CA5205CDB83F7C7A8FF006876FCABA2F889E0DB5FB2A78AFC33B25D22EC0926488710927EF01D949E08FE13EDD3CE372FA8FCEBB8F86FE394F0EDEBE99AA32CBA25F1293238DC2266E3763BA9E8C3D39EDC80755F07BC759D9E19D4E4E403F6191CF6EA6227F55FC47A575FE36F871A6F8C54DC03F64D494616E5173BF1D038FE21EFD47E95E41E3FF0749E0DD622BCD3A463A5DCB79B673A37FAA6EA1777A8EA0F71F435EC5F0EBC6B1F8C3415699906A56D84BA41DCF6703D1BF4391401E29AE7C38F12E832379DA6CB73083C4F680CA847AE07CC3F102B9CFB2DC799E5FD9E6F33FBBE5B67F2C57D7945007CCDA1FC38F12EBD22F93A6CB6D093CCF760C483DF07E63F8035ED3E0AF875A6F8393CE56377A93AE1EE645C6D1FDD41FC23F53EBDABB0AE03E2A78E4786348FB058CC1755BC5214AB60C11F42FEC4F41F89ED401C5FC5EF1D7F6A5E3681A6CBFE856CDFE94EA789A407EEFBAAFEA7E829FE04F0C59786747FF84D7C543647180F636EC39627EEB6DEEC7F8476FBDE84657C37F05DBEACF26BDAEEC8B43B0F9899B859D87383EAA3BFA9C0E79ACCF1FF008E25F18EB3BA3631E9B6E4ADAC24F6EEEDFED1FD071EA4806778A3C4F7DE2CD664D42F8EDCFCB1420E5614ECA3FA9EE6B1E9372FA8FCE8DCBEA3F3A005A29372FA8FCE8DCBEA3F3A005A28041E9CD1401DDFC31F1E3785B531637F21FEC9BA7F9C9FF960E780E3DBD7F3EDCFD0AAC18020820F420D7C7F5EDFF073C6A750B23E1FD425CDCDAA66D598F2F10FE1FAAFF2FA5007A9514514005145140051451400B494BF9527E54005147E547E5401CF78E3C511F84FC33717FC1B83FBAB643FC529E9F80E49F615F314F349733C93CF23492CAC5DDD8E4B313924FB935DB7C59F141D7FC56F696EFBACB4ECC31E3A349FC6DF98C7FC07DEB86A0028A28A00ED3E19F846CFC4BA9DE5D6AED8D2F4D8C493AE4AEF2724024738C2B138F415D0C9F17344B391A0D2FC1F686CD0E2366648CB0F5DA10E3F3A8FE15FFC893E34FF00AF6FFDA525796AFDD1F4A00F54FF0085CD65FF00427597FDFE5FFE3747FC2E6B2FFA13ECBFEFF2FF00F1BAF2CA2803D4FF00E173597FD09D65FF007F97FF008DD1FF000B96CBFE84EB2FFBFCBFFC6EBCB28A00F587F8E31CB02C32785E07897188DAEB2A31D303CBC5241F1BA0B572D6FE14B68988C131DC85247A711D79451401EBDFF0BF24FF00A1797FF034FF00F1147FC2FC93FE85E5FF00C0D3FF00C45790D1401EBDFF000BF24FFA1797FF00034FFF001155E6F8D96F7121927F09DACAF8C6E7B80C71F531D794D1401EB1FF000BC63FB37D9FFE116B7F23A795F6AF97D7A7978EB50FFC2E6B2FFA13ECBFEFF2FF00F1BAF2DA2803D4FF00E173597FD09D65FF007F97FF008DD1FF000B9ACBFE84FB2FFBFCBFFC6EBCB28A00F53FF85CD65FF427597FDFE5FF00E3747FC2E6B2FF00A13ACBFEFF002FFF001BAF2CA2803D785BF87FE2AE817F2E9BA5C7A56BD649E6058C0C49D700900060718C919538EDD7C841CD7A97C07FF918755FFAF45FFD0EBCB4F53F5A002ACE9BA8DCE91A95BDFD949E5DCDB48248DBB64763EA0F423D0D56A2803EADF0DEBB6FE24D06D354B5E1274C94CF28C38653F43915A95E17F05BC5074FD6A5D0AE5F16F7DF3C19E8B301C8FF008128FCD47AD7BA7E54005147E547E54005147E545002D251450015CD7C41F127FC22FE11BBBC8DB6DD49FB8B6FFAE8C383F8005BF0AE96BC17E34F887FB4BC4F1E950B660D3930F8E8656009FC86D1F9D0079C72793C9F534514500145145007A8FC2BFF009127C69FF5EDFF00B4A4AF2D5FBA3E95EA5F0AFF00E448F1A7FD7B7FED292BCB57EE8FA5002D145140051451400514514005145140051451400514514005145140051451401EA5F01FFE461D57FEBD17FF0043AF2D3D4FD6BD4BE03FFC8C3AAFFD7A2FFE875E5A7A9FAD00145145004904F2DADCC5716EE639A171246E3AAB03907F315F5478635D8BC49E1DB2D521007DA23CBA0FE071C32FE041AF94EBD6BE067887CBBABDD0667F9651F69B707FBC301C7E2369FC0D007B3D145140051451400514B450051D67548745D1EEF51B83FBAB585A5619C670381F52703F1AF946F2EE6BFBC9EEEE5F7CF3C8D2C8DEACC727F9D7B67C70D77EC9E1FB4D2227C497D2799201FF003CD30707EAC57FEF935E1B400628AD8D3F5E82D90457FA26997F0E79DF198A4C7B3C641FCC1AEBB49B2F871E262B031BFF000FDDB1C2A3DCEE889F40EC08FCF1401E73457A86B3F03753B6569347D460BD1D44532F94FF004079527EB8AF3BD5747D4344BB36BAA59CD6B37659571B87A83D08F71401E8BF0AFF00E448F1A7FD7B7FED292BCB57EE8FA57A97C2BFF9127C69FF005EDFFB4A4AF2D5FBA3E9400B4514500145145001451450014514500145145001451450014514500145145007A97C07FF00918755FF00AF45FF00D0EBCB4F53F5AF52F80FFF00230EABFF005E8BFF00A1D79FE8DE1ED57C4572D0E916135D3A9F99946113FDE63C0FC4D0066D15EABA5FC0DBAF2BCFD775782D5146E74B75DF81DF2ED8031F43595AB0F873E1F2D0595B5F7886E5782EF7463841FF0079719FC011EF401E7F5A1A06B12681AF58EA90E4B5ACA1C81FC4BD197F1524549A8EB697B1F956DA56996108E8208373FE2EE4B7F2ACBA00FAF609E3B9B78E785C3C52A87461D1948C83F95495C1FC1ED70EADE098ED646CCFA739B76C9E4A7543F91C7FC06BBCA0028A5A280128A5ACBF12EAEBA0F86F50D4988CDB40CEA0F77E8A3F16205007CFFF001475AFEDBF1DDF3236E86D316B17FC03EF7FE3C5AB91A5666762CEC59D8E589EA4F7352416D35CB1112671D4960AA3EA4E00A008A8AD9B6D0EC8953A878874DB50472A8B2DC38FFBE14AFF00E3D5AF6DE1BF074AC04BE386527D74A9147E64D005AF017C4CBDF0BCD1596A0F25D6904E361E5E01EA87D3FD9FCB15EE77763A4F8AF4654BA8A0BFB0B840E84F208238653D41F71835E416DF07ECB5785A4D0BC5D657A40CED11038FAED7247E55DBFC37D0FC43E135B8D1B5748A6B0C19ADAE209372A367E64C1C30CE770E31D7D68022B0F042F82FC3DE2E5B7B83359DDDA33C21FEFA6D8DF218F43D460D7CFCBF747D2BEAFF00147FC8A7AC7FD78CDFFA2CD7CA0BF747D280168A3F1A3F1A0028A3F1A3F1A0028A3F1A3F1A0028A3F1A3F1A0028A3F1A3F1A0028A3F1A3F1A0028A3F1A3F1A0028A3F1A2803D47E04807C41AA83D0DA28FFC7EBD72E26D27C23A049332C365A75A2676C6A001EC00EA49FC4935E47F023FE462D53FEBD17FF43AEA3E21F85FC49E37D522B0B2105A6936987F36793FD748472C157270A0E0671C93401E67E36F885A978C2E5A32CD6DA629FDDDAA9E1BD19CFF0011FD076F53C957A65EFC26D2F444075CF19D9DA3E33E5F90377E00BE4FE558173E1DF08464F93E372E4740749948CFD41A00E4A8AD6B9D12DD726C75BD36F0765DCF03FE52AA8FD6B32586481F6CAA54FE60FD08E0D0077DF0635AFECDF19358C8D8875188C78FFA68BF32FE9B87E35F4057C8DA7DF4BA66A36D7D6E7F7B6D2ACC9F5539FE95F5958DE45A858DBDE5BB6E86E235950FAAB0C8FE74013D14B450015E5DF1CB58FB3787ECB4A8DB0F7937992007F813B1FAB15FCABD43F0AF02F8DF248DE37811F2112C9360ED82CF93F9FF002A00F3BA08A28A0028A2AFE8FA449AC5E7942782D6041BE7BAB870B1C299C649EE7B0039268020B08EEE4BF8974D5B86BC27F742DC37999F6DBCD7BD780A4F1EC4B1C5E23B6824B43D259E602E507BEDC86FA360FBD71D6BE3FF000D781AC5ACFC21A6BDFDD30C4BA85C8F2FCC3EBFDE23FD9F94572FAC7C4AF146B4584BAA496D11FF0096569FB951ED91F31FC4D007D07E26707C2BACAEE0596C66C8CF23F76D5F292FDD1F4AF54F85CED27833C6CEEC599ADB2598E49FDD49DEBCAD7EE8FA5002D14518F6A0028A31ED463DA800A28A2800A28A2800A28A2800A28A3F0A0028A31ED463DA800A28C7B51401EA3F023FE461D53FEBD17FF43AE8FC7EFF0010EE0489A45AAC1A78CE7EC13EF9D87B92030FA28FC4D73BF01FFE461D57FEBD17FF0043AE7747F8A9E29D1D829BFF00B6C20FFABBC5F333FF0002E1BF5A00E4A75952E245B8591670C4482404386EF9CF39FAD32BD3B52F16F857E20DAF95AF5AB68BAB05C457E83CC8F3D8311C95F6238F515E77A969D36957AF6D71E5B32E0AC913878E453D195870548E86802AD18A28A002BE85F839ACFF0069F81E3B676CCBA7CAD6E7279DBF790FD3071FF01AF9EABD63E02C920D4F598864C4D0C4CDE8183301FA13401ED54527E1450015C17C51F0249E2CD3E2BBD382FF0069DA021149C79C879299EC73C8EDD477CD77D49401F215C5BCD6971241731490CF19DAF1C8A5594FA107A5475F52788FC19A2F8AA2C6A966AF281849D3E4953E8C3F91C8F6AF2DD7BE06EA36A5A4D0AFA3BC8FA886E3F7727D037DD3F8E2803CB68CD696ADE1DD5F4272BAAE9B756A01C6F78CEC3F461C1FCEB341CF4E6800AD1B7F0EEB577024F6BA36A53C2E3292476AECAC3D41039AD1F87FA6DB6AFE3CD26CEF6312DBBCACCE87A36D46600FA8CA8C8AED3C6BF14FC43A4F8B750D3F4E92DA1B6B5904680C21C9C004924FB9A00B1F0D746D4EC7C1DE2E8AF34DBDB7967B6C451CB0323487CB71850473C91D3D6BCD87853C4200FF008906AFD3FE7CE4FF000AE93FE171F8B7FE7EED7FF01968FF0085C7E2DFF9FBB5FF00C065A00ABE11F006A7AC789ECED355D2F52B3B1662D3CB25BBC636819DBB88E09381F8D759A9EBBF0DB45D4EEB4D93C2B348F672B40CEB12904A9C1E59F2791D4D43E0CF8B3ABDEF8AACAD75EBCB75B098B233089502B11F2E4F619C0FC6A4F10FC1AD7B55F11EA57F6B79A6886EAE6499048F20601989C10148EFEB4015FF00E130F867FF00428DC7FDF98FFF008E569687FF000AF7C717D268F63E1E9ECA7785A459B6842B8C742AC79E73C8C71589FF000A2FC4BFF3FBA4FF00DFC93FF88AE8FC0BF0E351F04EBD26B5AD5FE9C2D21B675631C8DC671C92CA000003401E5F79E0DD7ED6F6E2DD745D52658A46412259C855C038DC38E87AD43FF08A7887FE85FD5FFF0000E4FF000AEAEFBE327895B50B9363736EB6A657F2435BA9213276E7DF18A83FE171F8B7FE7EED7FF01968039BFF008453C43FF42FEAFF00F80727F851FF0008A7887FE85FD5FF00F00E4FF0AE93FE171F8B7FE7EED7FF0001968FF85C7E2DFF009FBB5FFC065A00E6FF00E114F10FFD0BFABFFE01C9FE147FC229E21FFA17F57FFC0393FC2BA4FF0085C7E2DFF9FBB5FF00C065A3FE171F8B7FE7EED7FF0001968039BFF8457C43FF0042FEAFFF0080727F85771E0BF0669FA6F87353F11F8D34BBB31D9B6D8AD2689909000CB6D246EC9600678E0FE197FF000B8FC5BFF3F76BFF0080CB5D8F86F5EBEF89BE06D7345BDBDB61AC31FDD865D83CBF948381DB20824671914018FF00F097FC33FF00A146E3FEFCC7FF00C728FF0084BFE19FFD0A371FF7E63FFE39557FE145F897FE7F749FFBF927FF001147FC28BF12FF00CFEE93FF007F24FF00E22802EEB9E1AD03C5BE06975FF07E93716B736D37966D92325A5008046C048C80C1811EF9AF3FFF008453C43FF400D5FF00F00E4FF0AF5826F3E12FC329ADE6BDB53ABDC5D16B6118DCB9257380C01202A924E3A902B8BFF85C7E2DFF009FBB5FFC065A00E97E0AE8FA9E99AE6A726A3A6DEDA235AAAAB4F032063BBA0C8E6BCD8F853C43B8FF00C48356EBFF003E727F85749FF0B8BC5BFF003F56BFF80CB47FC2E3F16FFCFDDB7FE032D00719756773633982F2DE6B799464C73465187E079A87DABD6BC577A7C5FF0006ED35FD4A1886A36F71B0491AE3237943F40460E3D457921207538A005A2B5F47F0A6B9AF95FECBD2EEA746E926CD91FF00DF6D81FAD7A1683F02EE242B2F883515897A982D3E66FC5C8C0FC01FAD007975869F77AA5EC767A7DBC9737329C24518C93FE03D49E057D19F0EBC163C1BA1B4733AC97F74C24B975E80818083D40E79F526B6341F0C693E19B6306936315B86FBEE3977FF00798F26B56800A2968A00292968A004A2968A006950CA558020F507A1AE7F52F00F863562CD77A2D9976EAF1A794C7F15C1AE8A8A00E334AF85BA0687AFDB6ADA68BB866B62C523336E43952A720827A1F5AE2BC67F09F5FD63C59A86A3A7BD9BDBDD49E62F9929561C004118F6AF68A4A00F9F7FE14B78ABD34FFF00C083FF00C4D27FC296F157A69FFF008107FF0089AFA128A00F9F3FE14B78ABD34FFF00C083FF00C4D4CBF08BC66AA156E2DC28E0017AE00FD2BDF68A00F03FF8549E35FF009FA83FF035FF00C29927C1FF0018CC9B659AD5D7FBAF76C47E4457BFD1401F3E7FC296F157A69FFF008107FF0089A3FE14B78ABD34FF00FC083FFC4D7D0745007CF7FF000A5BC55E9A7FFE041FFE268FF852DE2AF4D3FF00F020FF00F135F42525007CFBFF000A5BC55E9A7FFE041FFE2693FE14B78ABD34FF00FC083FFC4D7D0949401F3EFF00C296F157A69FFF008107FF0089A54F833E2C8D8321B1561D0ADC9047E38AFA0A8A00F03FF8549E35FF009FA83FF035FF00C28FF8549E35FF009FA83FF035FF00C2BDF28A00F9FA4F837E2E99B74AF64ED8C65EE893FA8A6FFC296F157A69FF00F8107FF89AFA0E8A00F9F3FE14B78ABD34FF00FC083FFC4D27FC296F157A69FF00F8107FF89AFA128A00E33C3FE02861F87F6DE1DD7C2DCA890CB2AC5232AE4B96032304815ADA6782BC3BA4156B1D1ACA375E8E630EE3FE04D93FAD6ED250018A2968A004A2968A004A2968A00E33FE16D783FF00E82AFF00F80B37FF001347FC2DAF07FF00D055FF00F0166FFE26BE75CE013E82AD9D32EBED32DB88C3C9122BB043BB21B6EDDB8EB9DCB8C7AD69C88573DFFF00E16D783FFE82AFFF0080B37FF1347FC2DAF07FFD055FFF000166FF00E26BE7BFB15D6E997ECB3EE806661E537EEFFDEE38FC6A4BAD32F2D24B849AD665FB3398E66084AA1F76C63FFD628E44173E80FF0085B5E0FF00FA0ABFFE02CDFF00C4D1FF000B6BC1FF00F4157FFC059BFF0089AF07B7D02F67B779DC416C8ADB145DCCB0191B6862AA1B193820F381C8F5151CBA26A514C917D86E1DDEDD6E9445133E6260087E074E704F40723B51CA80F7CFF85B5E0FFF00A0ABFF00E02CDFFC4D1FF0B6BC1FFF004157FF00C059BFF89AF01B2D22FB504592DEDA43036FC4ECA562CA233B0DE78CED53C6691B4DB84B237522796995C2BE55C86190C01EC41E0D1CA82E7BFF00FC2DAF07FF00D055FF00F0166FFE268FF85B5E0FFF00A0ABFF00E02CDFFC4D7CEB451C882E7D15FF000B6BC1FF00F4157FFC059BFF0089A3FE16D783FF00E82AFF00F80B37FF00135F3AD147220B9F457FC2DAF07FFD055FFF000166FF00E268FF0085B5E0FF00FA0ABFFE02CDFF00C4D7CEB451C882E7D15FF0B6BC1FFF004157FF00C059BFF89A3FE16D783FFE82AFFF0080B37FF135F3AD147220B9F457FC2DAF07FF00D055FF00F0166FFE268FF85B5E0FFF00A0ABFF00E02CDFFC4D7CEB451C882E7D15FF000B6BC1FF00F4157FFC059BFF0089A3FE16D783FF00E82AFF00F80B37FF00135F3AD147220B9F457FC2DAF07FFD055FFF000166FF00E268FF0085B5E0FF00FA0ABFFE02CDFF00C4D7CEB451C882E7D15FF0B6BC1FFF004157FF00C059BFF89A3FE16D783FFE82AFFF0080B37FF135F3AD147220B9F457FC2DAF07FF00D055FF00F0166FFE268FF85B5E0FFF00A0ABFF00E02CDFFC4D7CEB477A39105CFA2BFE16D783FF00E82AFF00F80B37FF001347FC2DAF07FF00D055FF00F0166FFE26BE75A32338CF3E947220B9F457FC2DAF07FF00D055FF00F0166FFE268FF85B5E0FFF00A0ABFF00E02CDFFC4D7CEB451C882E7D15FF000B6BC1FF00F4157FFC059BFF0089A3FE16D783FF00E82AFF00F80B37FF00135F3A9E064F029372FF00787E747220B9F45FFC2DAF07FF00D055FF00F0166FFE268FF85B5E0FFF00A0ABFF00E02CDFFC4D7CE9B875C8FCE80CA4F0C3F3A39105CFA29FE2DF8415491A9C8C7D05ACB9FD568AF9DA8A39105C056F596BB05BDADB23C2EF3EC682E1C80418C2B2C7B464648DE720E3845E7D30E41B5D94740714DABB01B17DA95B5F5A881A49904277446381555FE4550ACBBF8C6D00364F04F15627D72D25BC5BAC5D03119CA4385D9279A598EE39E31BC83C1DC157A76E7E8A5603A8D33C4B6B6D7D7D737571A8CB0DD5C34B25898E3922B94ECAE5CFCA7B1600903A54D078A74F611897FB4ADF06CE576B5DBBB7DBA14080961F2118604F2AD9E1AB91A28E503AE4F165936A367A93C3711CF6D14910B25457B5F99650AC0161DE4195C73F31CF38AC1D72FA2D4B579EF61F3FFD20891D666DC55C8F9806CF2A0E704F38C66B3E928B5805A28A29805145140051451400514514005145140051451400514514005145140056AE97A8D8DB5B2C57D63F69C4B927207EECF257B1277853D471B877ACAA2803692FB460006D30E0ED3F743152376792D9604B03838FBA067BD489ABE9490CD0AE9AC903E36C6304E76152CCC4E5B939038008078E41C1A29580DE8B53D0E1984834972BC8642C3E70548DB9CFCB8C8F9864B633C557B7BAD26289567B2925605F2D803764E41FBDC6065703A7DEE4F1593451603664D4B49DA4C1A5FD9DC642329DC70720E72482429E3DC66AF7FC243A6ACC5FECF3B0690B7CD14794F976AB2907EFE3924F5383C600AE628A2C074A7C43A66C609A7BA9DAA109546D801C88FB6E407079E5B041C03C4373AF5ACCB7312C1208A55988DC88C43B050A47F7464138078DC40E9581451600345213453B81FFD9"
Discord: Npc Bugado#9074



local config = {
delrey = getPlayerCarValue(cid, DELREY),
cigarro = getPlayerCancer(cid, DERBY),
prostituta = getPlayerAIDS(cid, cracuda),
tresOitao = getPlayerRevorvi(cid, 38)
}
if(delrey == "Ligado" and cigarro == "Aceso" and prostituta == "No Colo" and tresOitao == "Carregado") then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Começou o fim de semana. #PAS")
end


User avatar
Gio
Posts: 1075
Joined: 30 Sep 2013, 10:54
Location: Brazil

Re: Trocar de imagem quando passar o mouse por cima  Topic is solved

01 Oct 2020, 16:34

Bom, sua pergunta não é sobre colocar binários de imagens dentro do script certo?

Então vamos simplificar o código do tutorial para a parte que interessa.

Salve os três arquivos de imagen anexos na mesma pasta do script abaixo e depois execute o script abaixo. A parte das imagens vai ficar clara para você (e eu ainda deixei no código a parte da troca do cursor pra mãozinha, mas se ainda estiver complicado de analisar, podemos tirar isso também).

Code: Select all

Message_Monitor() ; Esta função vai acionar funções OnMessage() que monitorarão o movimento e os cliques do moue na tela (executando algumas ações se isso ocorrer dentro da área da imagem). 

; A rotina abaixo cria a tela com a imagem do botão simples que reescrevemos logo acima.
CREATE_WINDOW:
Gui, add, text, x20 y20 w360 Center, A imagem abaixo é um botão
Gui, add, picture, BackGroundTrans x156 y50 Center, %A_ScriptDir%/solto.png
gui, show, w400 h300, Exemplo de botão usando controle to tipo imagem
WinHwnd := WinExist()
HandCursor := DllCall("LoadCursor", "Uint", WinHwnd, "Uint", 32649)
Return

; Esta função monitora  movimentos do mouse e cliques. Ela aciona as funções abaixo dela conforme ocorram as ações na tela (movimento ou clique).
Message_Monitor()
{
	OnMessage(0x200, "CheckCursor")
	OnMessage(0x201, "CheckClick")
}
Return

; A função abaixo monitora a posição do mouse. Se o cursor passar sobre a imagem, a função muda o cursor do mouse para uma mãozinha e também muda a imagem do botão (Efeitos estéticos de animação).
CheckCursor(WParam, LParam, Msg)
{
	Global
	MouseGetPos, Xcoord, YCoord
	If (A_Gui = 1 AND XCoord >= 156 AND XCoord <= 243 AND YCoord >= 70 AND YCoord <= 150) ; Esta é a matemática que determina se o cursor está sobre a área da imagem.
	{
			DllCall("SetCursor", "Uint", HandCursor)
			If (Botao_Aceso = 1)
			{
				Return
			}
			GuiControl,, Static2, %A_ScriptDir%/mouse_em_cima.png
			Botao_Aceso := 1
	}
	else
	{
		If (Botao_Aceso)
		{
			GuiControl,, Static2, %A_ScriptDir%/solto.png
			Botao_Aceso := 0
		}
	}
}
Return

;  A função abaixo monitora os cliques na tela. Se um clique for feito dentro da área da imagem, ela muda a imagem do botão (efeito estético) e aciona uma ação (um msgbox, somente para exemplo.) 
CheckClick(WParam, LParam, Msg)
{
	Global
	Gui +OwnDialogs
	MouseGetPos, Xcoord, YCoord
	If (A_Gui = 1 AND XCoord >= 156 AND XCoord <= 243 AND YCoord >= 70 AND YCoord <= 150)  ; Esta é a matemática que determina se o clique ocorreu dentro da área da imagem.
	{
		GuiControl,, Static2, %A_ScriptDir%/apertado.png
		Msgbox % "Você clicou no botão! `n(Indique a ação correspondente no lugar desse comando de msgbox)"
		Sleep 200
		GuiControl,, Static2, %A_ScriptDir%/solto.png
	}
}
Return

Imagens:

apertado.png
apertado.png (4.05 KiB) Viewed 172 times
solto.png
solto.png (778 Bytes) Viewed 172 times
mouse_em_cima.png
mouse_em_cima.png (1.52 KiB) Viewed 172 times

Return to “Ajuda e Suporte Geral”

Who is online

Users browsing this forum: No registered users and 3 guests