some questions concerning GWCA

12/10/2009 00:49 sospam#1
Hey Everybody,

I've been using GWCA since yesterday and ran into some questions:

1.) Is it just me or doesn't it work with Windows 7? It works just fine on my laptop( XP) but when I try to start guildwars on my Pc the Client API window opens along with the update screen as normal but shuts down as Guildwars itself is started. The game runs normally after that.
I've tried executing using admin rights and compatibility mode but so far I didn't succed.

2.) In my script I'm using CA_GetAllegiance to determine wether an agent is hostile or not. When running the script this afternoon everything worked well but now it only works 50% of the time. For troubleshooting I did this:

I noticed that, while this should give me a constant tooltip showing my targets Allegiance, the Tooltip was somewhat unsteady.
When Guildwars isn't focused the downtime of the Tooltip increases drasticly.
Can anybody tell me why this happens and how to work around it?

tia
12/10/2009 07:24 SuneC#2
1) GWCA was made before Windows 7 and since I don't have access to a Win7 PC, I can't test how well it functions. I've heard some users say that it's working for them on Win7, but that's no guarantee for you, I'm afraid.

Try using the latest revision that doesn't include LUA and the info window (rev116). Hopefully it'll work!

2) Is that your whole script? If so, I understand why it won't work. You've forgot to do $cGUI = GUICreate("GWCA") and GUIRegisterMsg(0x500, "WndCallback").
When using GWCA, no matter if you use a GUI interface or not, you have to create a new one assigned to $cGUI.
When you say it works 50% of the time, it just confuses me though, that makes no sense.

The speed of window messages (which GWCA uses), can vary a lot. If you are having great issues with speed reduction when not focused your PC sounds pretty slow.

I have developed another method of doing communication between script and Dll though, so I might implement that. With a speed increase of around 10x. But it's a lot of work, so definitely won't happen before the Wintersdays.
12/10/2009 12:00 sospam#3
Quote:
Originally Posted by SuneC View Post
2) Is that your whole script? If so, I understand why it won't work. You've forgot to do $cGUI = GUICreate("GWCA") and GUIRegisterMsg(0x500, "WndCallback").
When using GWCA, no matter if you use a GUI interface or not, you have to create a new one assigned to $cGUI.
When you say it works 50% of the time, it just confuses me though, that makes no sense.

The speed of window messages (which GWCA uses), can vary a lot. If you are having great issues with speed reduction when not focused your PC sounds pretty slow.

I have developed another method of doing communication between script and Dll though, so I might implement that. With a speed increase of around 10x. But it's a lot of work, so definitely won't happen before the Wintersdays.
Thank you for the fast answer. I tried using the latest version but it didn't help. But If you know some people who are able to use GWCA in conjunction with windows 7 then I guess the problem must be somewhere on my end.


You are right, thats not my whole script. I just rewrote the script here from my mind instead of copying it and forgot about the gui. My laptop is a 1.8GHz dual core with 2gb ram and a gforce 7600go. I know thats not top-notch but I don't think its too slow... (well, I hope it isn't:D).

Sometimes CmdCB($CA_GetAllegiance,$Agent) just comes back blank (this doesn't chage if I switch to CmdCBEX).
For example I wrote this script for interrupting:

This works perfectly within approximatly 3ms until I uncomment this part:

;CmdCB($CA_GetAllegiance,$Agent) ;check wether spell is casted by an enemy
;If $CBVar[0] <> 768 then return

At wich point the function stops to work. When trying to find the error myself I noticed that $CBVar[0] is blank all the time and so the condition is not met.
If I just uncomment the CmdCB(...) part then the time goes up to about 20ms... (I dont know if this is relevant).

Furthermore I've ran into a third question:
3.) what exactly does CA_SetEngineHook do?
from the describtion I thought that it only disables the rendering of the graphics but when I used it in the above script (inserted before the loop) I noticed that the time needed to run the _interrupt function goes up to over 2 seconds.
12/10/2009 14:54 in MIND#4
gwca works WONDERFUL with win7 (as it does on winxp and winvista)
if u still got problems using gwca feel free to contact me on icq (or skype or msn) then ill try to solve ur problems
12/10/2009 16:34 SuneC#5
@sospam:
Your laptop ain't topnotch, that's true, but not exactly slow either. I guess you're just being unlucky with the speeds.

The issue with $CA_GetAllegiance (and as a matter of fact also $CA_GetMyDistanceToAgent) is due to a limitation of AutoIt (and most other languages).
Inside a WndProc (which Interrupt() is), you won't "jump" out when you receive a new Window Message.
All this means, that you cannot use CmdCB() inside Interrupt()! Instead, have a look at the $tagSKILLLOGSTRUCT defined in GWCAConstants.au3 - here you will actually find what you are looking for!
Code:
Global $tagSKILLLOGSTRUCT = "long AgentId;long MyId;long SkillId;float Activation;byte TeamId;ushort Allegiance;float Distance;long Ping"
So to get the Allegiance of the caster, simply get the "Allegiance" variable using DllStructGetData($skillStruct, "Allegiance").
And same for Distance to the agent. Use the "Distance" variable here.

To get the skill recharge of certain skills will have to be done in your main loop though. For example, you could do a check on all the skills you wish to use to interrupt every 100ms and save the data to global variables (possibly an array?).

And last but not least, $CA_SetEngineHook. Your PC is very strange, since this command should increase your performance by a lightyear xD Maybe it was caused by the CmdCB() calls? Get rid of them atleast.


Hope it'll work with the changes I mentioned!
12/10/2009 19:35 sospam#6
Quote:
Originally Posted by in MIND View Post
if u still got problems using gwca feel free to contact me on icq (or skype or msn) then ill try to solve ur problems
danke für das Angebot, ich denke ich werde darauf zurückkommen (vermutlich erst morgen, heute ist meine Zeit so knapp)


@ SuneC:
Ahhhh, that worked like a charm. Now I feel kinda stupid because I didn't realize that I already had the information I was trying to get using the CmdCB commands:facepalm:
Thank you for the explanation, too. Now I know what I need to avoid.

$CA_SetEngineHook still doesn't do what I thought it would (it boosts the performance a lot but it seems to delay the commands). Anyway, I don't think I need it anymore since the whole process is fast enough without it now due to your help!
12/11/2009 13:28 sospam#7
Quote:
Originally Posted by in MIND View Post
gwca works WONDERFUL with win7 (as it does on winxp and winvista)
if u still got problems using gwca feel free to contact me on icq (or skype or msn) then ill try to solve ur problems
Yes, you are right. I found the reason why it didn't work and it had absolutely nothing to do with GWCA but rather with a wrong registry entry.
When I fixed the entry everything started to work properly :)
12/12/2009 21:03 NANAAA#8
Wollte nicht nen neuen Thread erstellen daher frag ich hier ^^

Mein Guild Wars stürzt sobald ich ein Bot/Script mit Gwca ausführe ab -.- , die game.dll ist injectet weil der CharacterName wird angezeigt (Guild Wars - Nam...e) geht es jemandem ähnlich ?
12/12/2009 21:18 Xereon#9
Quote:
Originally Posted by NANAAA View Post
Wollte nicht nen neuen Thread erstellen daher frag ich hier ^^

Mein Guild Wars stürzt sobald ich ein Bot/Script mit Gwca ausführe ab -.- , die game.dll ist injectet weil der CharacterName wird angezeigt (Guild Wars - Nam...e) geht es jemandem ähnlich ?
brauchst rev118:

Quote:
Fixed the crash bug when using commands that sends packets after the 10/12/2009
GW game update.
Previous revisions will most likely not work anymore!
12/15/2009 17:29 Moppel123#10
Hallo, habe auch mal eine Frage. Und zwar will ich, dass mein Char nur zum Gegener läuft, ihn aber nicht angreift. Dies habe ich so gelöst:

CmdCB($CA_Getcurrenttarget)
CmdCB($CA_GoAgent,$cbVar[0])

Allerdings geht es nicht. Wenn ich über den Commander das auslese + manuell eingebe, geht es dorthin.

Danke schonmal und ich hoffe, meine Frage war nicht zu dumm :-)
12/15/2009 18:01 buFFy!#11
Probier das mal

Code:
$cbType = 'int'
CmdCB($CA_GetCurrentTarget)
If $cbVar[0] <= 0 Then
	CmdCBEx($CA_GetCurrentTarget)
EndIf
Cmd($CA_GoAgent, $cbVar[0])
12/15/2009 18:19 kknb#12
was hat das "ex" zu bedeuten?
12/15/2009 18:27 ddl#13
is ne bisschen abgewandelte form von cmdcb
falls das mal nicht funzt
12/15/2009 18:30 sospam#14
Quote:
Originally Posted by kknb View Post
was hat das "ex" zu bedeuten?

wenn ich das richtig interpretiere bedeutet das "ex" nur, dass dem DLLCall der normalen CmdCB Funktion mehr Zeit gegeben wird um ein Ergebnis zu liefern.

-----

I just ran into another question concerning CA_GetHex and CA_GetEffects:

CA_GetHex doesn't seem to work as it always returns a non zero value, even if the target is not hexed and the value returned doesn't change when the target actually becomes hexed.

When working with CA_GetEffects there seem to be 6 classes:

class 1 to 5 contain the different conditions while class 6 tells wether the target is enchanted.
I figured that the ID's of the condition classes consist of a general condition indicator [2] plus a modifier that is individual to every class (0,1,8,32,64). With that knowledge one can break down the Number returned by CA_GetEffects into the individual classes:

My Problem is that once you have a condition of class 2 or above there is no way of telling if you also have a class 1 condition since the class 1 modifier is 0.

Is there any way to work around this and is it possible to differ between the individual condion(s) in a class?
12/15/2009 18:43 Xereon#15
Quote:
Originally Posted by sospam View Post

wenn ich das richtig interpretiere bedeutet das "ex" nur, dass dem DLLCall der normalen CmDCB Funktion mehr Zeit gegeben wird um ein Ergebnis zu liefern.
Nö es gibt einfach nur ein TimeOut.