Board ArchivesSite FeaturesActiveworlds SupportHistoric Archives |
xelag // User Search
xelag // User SearchTo xelagot script makers!Nov 15, 2000, 5:09pm
Well LOL, 'bout chewing ram... 2.9999952 fixes a problem introduced
probably a couple of months ago: the Server software in xelagots, av99bots, srvcxlgbots and the stand-alone versions, even if it was not being used, was very slowly but surely chewing up memory (memory leak). This bug has now been fixed in all bots and servers. XelaG. [View Quote] Xelagot script to eject when ppl swearNov 9, 2000, 8:09pm
I agree 100% with Anduin Lothar: bots should not be allowed to take
decisions like this. If a human, after cosidering a case, decides a bot must eject a certain person, that's ok with me, but the human decides, not the bot :) XelaG [View Quote] A simple program to audible announce visitors?Mar 12, 2001, 6:42pm
I don't know if that is possible, but my xelagot bot has an option to
produce a sound (wav) on your computer when someone arrives. There must not be any wavs playing in the world though, they take over. Of course, only you, your wife/husband and granny hear it, no one in the world does :) XelaG [View Quote] A simple program to audible announce visitors?Mar 14, 2001, 12:20am
A simple program to audible announce visitors?Mar 14, 2001, 1:34am
A simple program to audible announce visitors?Mar 16, 2001, 10:11am
How do u make a Bot in VisualBasicMar 16, 2001, 10:12am
Need Help..Mar 19, 2001, 7:25pm
Try this: 1 * X + Y
This makes sure you are dealing with numbers if you use variants. XelaG [View Quote] Xelagots: new approach to disconnectsMar 27, 2001, 4:15am
For Xelagot users:
The latest version fixes the Announce Text bug introduced a week ago. For programmers: It also has a brand new way of dealing with disconnections. Up to this version, the bot relied on the SDK to handle disconnections. Very often, the blocking action of the Winsock code used by the SDK would freeze the bot and user interface during a disconnection. Now, I use the following method: 1. If the session number of the bot (aw_session), which I monitor at every 'heartbeat' and in every event handler and callback, changes to one of these: RC_CONNECTION_LOST RC_UNABLE_TO_CONNECT RC_NO_CONNECTION I issue and aw_destroy to log off the bot, and try periodically to create a new instance and log the bot back in until this succeeds. 2. But, if the bot gets a world error event indicating a disconnection, without its session number changing to an error code as above, I issue a aw_exit and then periodically an aw_enter. So the bot still stays in the Universe in this case. The codes I use here are the ones given in the event world_disconnect for rc: RC_CONNECTION_LOST // 471 RC_UNABLE_TO_CONNECT // 429 RC_NO_CONNECTION // 439 RC_NO_SUCH_WORLD // 27 RC_WORLD_NOT_RUNNING // 489 (admin closed world) These same error codes are tested in the aw_enter callback: any other error code will stop the bot from carrying on trying to enter the world, these five will trigger a timer (60 seconds later) to issue a new aw_enter. Note that blocking still occurs: aw_login and aw_enter block. The callbacks for both of these, as far as I could establish, are synchronous instead of asynchronous: the function returns only after the callback has triggered. But this blocking is less, usually, than the one happening during disconnections if one leaves the SDK go it's way. A few weeks ago, Roland advised me to use a similar method to the one I have now adopted: at any sign that something has gone wrong, destroy the instance and try to log back in. I am using a slightly milder approach :) XelaG programming question (Delphi)Mar 30, 2001, 9:36pm
Can you give an example of what IsNumeric does? In Delphi, when I parse a
string and expect an integer, for example, I could use this: function IsInteger(const s: string): Boolean; var n: Integer; begin try n := StrToInt(s); Result := True; except Result := False; end; end; a similar method can be used for others, like for Double etc... Hope this helps. XelaG [View Quote] programming question (Delphi)Mar 31, 2001, 7:48am
I've used these for a long time, maybe they are useful to you. Note that I
break the search in ExtractVal if a letter E is found, because E is a sign for exponential, and is considered by Delphi as part of a number. I think you could use ExtractNumber. function ExtractVal(var ss: string; var vv: Double): Boolean; {ss and v only change if first part of ss contain a Real} var s: string; i, k: Integer; v: Double; begin Result := False; if Length(ss) = 0 then exit; k := 1; while (Pos(ss[k], '.+-') > 0) do begin inc(k); if k > Length(ss) then break; end; s := ss; for i := k to Length(s) do begin try if CompareText(s[i], 'e') = 0 then break; v := StrToFloat(Copy(s, 1 , i)); vv := v; if i < Length(s) then ss := Copy(s, i + 1, Length(s)) else ss := ''; Result := True; except break; end; end; end; function ExtractNumber(const a: string; var a1: string; var nr: Double; var a2:string): Boolean; // splits string into 3 parts: a1, numeric nr, a2 if successful var i: Integer; s: string; d: Double; begin Result := False; a1 := a; nr := 0; a2 := ''; if Length(a) = 0 then exit; for i := 1 to Length(a) do begin s := copy(a, i, Length(a)); if ExtractVal(s, d) then begin Result := True; if i > 1 then a1 := Copy(a, 1, i-1) else a1 := ''; nr := d; a2 := s; break; end; end; end; [View Quote] programming question (Delphi)Mar 31, 2001, 8:03am
Another interesting one is this one.
'a' is a string you want to split 'sep' is a substring where string 'a' has to be split, it can be a space, or a comma, or any combination of characters. 'tail' is what is left over after splitting string 'a' action = 0 if you don't want to 'trim' both string 'a' and 'tail' if sep is not found, then it returns 'a', and 'tail' is empty. function ZSplit(a, sep: string; var tail: string; action: Integer): string; var u, l, lsep: Integer; r: string; begin if action > 0 then a := Trim(a); r := a; tail := ''; u := Pos(sep, a); if u > 0 then begin l := Length(a); lsep := Length(sep); r := Copy(a, 1, u-1); if action > 0 then r := Trim(r); if u+lsep <= l then tail := Copy(a, u+lsep, l-u-lsep+1); if action > 0 then tail := Trim(tail); end; Result := r; end; programming question (Delphi)Mar 31, 2001, 8:16am
Same one, with uppercase L .... :)
function ZSplit(a, sep: string; var tail: string; action: Integer): string; var u, L, Lsep: Integer; r: string; begin if action > 0 then a := Trim(a); r := a; tail := ''; u := Pos(sep, a); if u > 0 then begin L := Length(a); Lsep := Length(sep); r := Copy(a, 1, u-1); if action > 0 then r := Trim(r); if u+Lsep <= L then tail := Copy(a, u+Lsep, L-u-Lsep+1); if action > 0 then tail := Trim(tail); end; Result := r; end; X1 2.9999950, Av99Bot and SrvcXlgBot 1.66 are out!Nov 12, 2000, 6:55pm
The new versions of the bots are out: http://www.imatowns.com/xelagot/. See
What's New for more details: http://www.imatowns.com/xelagot/xlgwhatsnew.html XelaG AW_AVATAR_DELETE and JoiningApr 3, 2001, 1:49pm
I never noticed this, so i tried it... and no problem, my bot gets an avatar
delete whenever i leave by any means... except sometimes during disconnections, when the world server acts funny (ghost avatars). XelaG [View Quote] Re: Anyone know how to make a bot respond in VB?Apr 3, 2001, 2:23pm
If you don't call AW_WAIT, you don't collect the events anyway, and after 60
seconds or so, your bot gets disconnected. So as MrGrimm says: *install* the event handler using AwEventSet AW_EVENT_AVATAR_ADD (or else sdk_EventAvatarAdd() will never get triggered because it is not recognised as an event handler by the aw.dll), and then *call* sdk.AwWait 0 once a second (or more often if you like, I call it 16 times a second now in the new xelagot, the AW browser calls it at every frame). To call AwWait, you can use a windows Timer if you like, set to an interval of 1000 milliseconds or even less (mine is at 64 milliseconds) XelaG [View Quote] Re: Anyone know how to make a bot respond in VB?Apr 3, 2001, 3:33pm
[View Quote]
aw_state_change? LOL :)
Build 20 of the SDK now availableApr 4, 2001, 10:53pm
Tony, the question mark corresponds to a world status of
AW_WORLDSTATUS_UNKNOWN, this happens I think when the connection between the world server and the universe server is not fully operational. They may have been having connection problems yesterday. [View Quote] Saying speeches with a XelagotNov 17, 2000, 5:52pm
Are you tired of copy-pasting your speeches one line at a time into the AW
browser? Use a Xelagot to deliver them! X1 version 2.9999953 has this ability through the user interface. Previously, you needed to write a script to deliver a speech with a xelagot, now you can just copy-paste your speech (or part of it) into the bot's chat or whisper box, and hit ENTER. The speech will be delivered at a reasonable pace, one line at a time. If you need to stop all ongoing speeches, go to the menu "Bot | Kill Text" and click on it. Xelag. http://www.imatowns.com/xelagot/ Build 20, Delphi? Anyone?Apr 4, 2001, 2:26pm
Build 20, Delphi? Anyone?Apr 4, 2001, 5:43pm
Nightwalker:
If you have build 19 of Canopus' Delphi SDK, you need to change one thing and add 2 in the akAWAPI.pas change AW_BUILD = 19; to AW_BUILD = 20; Then, in the type AW_ATTRIBUTE, you need to look for these attributes: .... AW_WORLDLIST_NAME, AW_WORLDLIST_STATUS, AW_WORLDLIST_USERS, AW_EJECT_SESSION, AW_EJECT_DURATION, .... and add, after AW_WORLDLIST_USERS, AW_WORLDLIST_MORE: .... AW_WORLDLIST_NAME, AW_WORLDLIST_STATUS, AW_WORLDLIST_USERS, AW_WORLDLIST_MORE, AW_EJECT_SESSION, AW_EJECT_DURATION, .... As last addition, look for type AW_WORLD_STATES =( AW_WORLDSTATUS_UNKNOWN, AW_WORLDSTATUS_PUBLIC, AW_WORLDSTATUS_PRIVATE ); Add at the end AW_WORLDSTATUS_STOPPED (dont forget tp add a comma after AW_WORLDSTATUS_PRIVATE): type AW_WORLD_STATES =( AW_WORLDSTATUS_UNKNOWN, AW_WORLDSTATUS_PUBLIC, AW_WORLDSTATUS_PRIVATE, AW_WORLDSTATUS_STOPPED ); That's all as far as changes in the wrapper. If you use the world list, you have to change the way you handle the callback AW_CALLBACK_WORLD_LIST. Supposing your callback is called cbkWorldList(rc: Integer); procedure cbkWorldList(rc: Integer); var BtInstance, BtSession: Integer; NeedMore: Boolean; begin BtInstance := aw_instance; BtSession := aw_session; NeedMore := aw_bool(AW_WORLDLIST_MORE) <> 0; // here test NeedMore: if NeedMore then begin // more worlds to come // call again aw_world_list() for your BotInstance end else begin // all worlds have been received // process your world list end; end; Cheers, XelaG [View Quote] Re: Anyone know how to make a bot respond in VB?Apr 4, 2001, 8:08pm
[View Quote]
Lots of benefits: when doing intensive property querying, for example, it
runs *much* faster, because it is only when you call aw_wait that the bot collects the info sent by the servers (events, callbacks) and consequently can act upon that information. So, if you collect it once a second, you can only respond once a second, but if you collect 16 times a second, you can spead up the response. Obviously, if the bot is doing nothing and there are little or no events coming, this benefit won't show. I could test the difference when I made the new 3.1 world backup routines using the cell iterator. The backup was done16x faster when I changed the bot's heartbeat (where it calls aw_wait) from 1 beat a second to 16 beats a second ! Re: Anyone know how to make a bot respond in VB?Apr 4, 2001, 8:51pm
Well, if you can have 16 frames per second with the aw browser, your cpu can
handle it :) The aw browsers call aw_wait at each frame. A word of caution: if you go too fast, remember that the aw coordinates are expressed in integers (cm)... if you move your bot's coordinates at such small intervals, you might reach the point when your step per interval will get so small that it will be under the centimetre mark and your bot will not move, I had problems with that for implementing walk, join, etc. XelaG [View Quote] Exact Positioning of Avatars (Browser vs SDK)Apr 8, 2001, 12:22am
What you see in the browser is not what you get :)
Try this: give your bot 2 commands, one after the other: warp to x y z, seed object where you are. You will see the bot moving towards its destination, and if that is like say 20m away, while the bot is still half way on the road the object will appear at destination. This is a normal consequence of the browser's need to show fluid movement... The position of an avatar in the browser is calculated by the browser, not by the world server. The world server, in my experience, sends the correct coordinate, but the browser sometimes fails. A notorious example in the past (which is now apparently solved) was the zero altitude bug. If you teleported from any altitude to zero altitude, without changing other coordinates, the browser would not show the change... this was easy to verify, all browsers watching the avatar would suffer from this illusion, you just needed to move your bot (or your own avatar if you were the one who had moved to 0a) one centimeter forward, and it would also descend/ ascend to 0a in all renderers. I mentioned a similar bug when 2.x appeared: in some occasions, my bot would move towards me, but the browser would fail to register... but if I changed from 1st to 3rd person view, suddenly my bot would adopt the correct position. Possibly related to these bugs is the still occuring 'sunken' avatars, especially noticeable with old avatars which have the 0 0 0 coord at eye level. And the 3.0 browser introduced an even more noticeable bug, especially noticeable when bots are involved: if an avatar moves in a straight line exactly from north to south, the avatar keeps twitching back to face north. The first time I noticed this was when making a script for a ship bot... the enormous Galleon was acting spastic when going from north to south, and only when it was moving exactly to a southern coordinate without changing the western one. I don't know if this bug is still there. There seems to be a permanent problem with the last step of the avatar in the browser... the routine for that should really be checked. XelaG [View Quote] Exact Positioning of Avatars (Browser vs SDK)Apr 8, 2001, 3:37am
Exact Positioning of Avatars (Browser vs SDK)Apr 8, 2001, 7:06pm
Do you mean: your bot clicks on the object, and it should get an
aw_event_object_click? I'm not sure what you mean LOL :) XelaG [View Quote] new X1 script i made ( this has the atached file lol)Apr 9, 2001, 11:44am
Hi ocean boy,
Nice script :) Did you notice on my script download page a script called Skull Counter Bot? It does a similar thing, only for a larger area, and allows you to clean up the corpses ... maybe you would like to improve it, like after counting to give the posibility of saving to file and of deleting using some command? XelaG [View Quote] new X1 script i made ( this has the atached file lol)Apr 9, 2001, 4:27pm
Possible bug with DeeJay part of XelagotApr 11, 2001, 9:12am
Check the help files about this.
1. X1 does not scan the area so as not to interrupt building and other activities, it remembers (on file) the object numbers. Because of that, the object numbers can get out of sync. This was supposed to be a feautere, but turns often into a bug. If its never built the objects, it makes them, and remembers the number the sdk passes it *before* the object is sent to the server and between sessions, keeps the numbers on file. These number are used to delete the objects. X1 does not use object change, it used object delete (which can fail) and object add. 2. There have been problems with negative coordinates at cell boundary (east and southern regions), that the browser did not refresh properly. I thought Roland had fixed this. 3. In some future release, I will attempt to better this code... when I have time :) [View Quote] |