ThreadBoard ArchivesSite FeaturesActiveworlds SupportHistoric Archives |
Xelogot Script Help (Bots)
Xelogot Script Help // Botsjust inDec 20, 2001, 2:25am
Could someone please give me a hand with a simple Xelogot script... either
contact me email or t'gram I need a script that will create change and delete objects based on the time of day eg... at 1:10pm create a wavspk at 1:15pm delete same wavspk at 1 minute intervals change sign3 to alternate display from "Hello" to "Welcome" and back Thanks, Justin (user: Just In, justefyde at hotmail.com) whoDec 20, 2001, 9:00am
Hmm wonder if you get this reply, I have a feeling I am on your
blacklist.. ;) Anyway, remember its imperative for this tacked together script that the $BoardAct is specific or the bot will find every sign in existence and mess up the change. The script can be well improved on, it is in its current method as its pieces put together from other scripts. Also you will need to create a text file in the script dir called obs1.txt which has just one line as follows: model= Create a sign and have the action field exactly match the $BoardDes (or vise versa) And then run the script..... [Head] Type=Script Version=2.0 [Settings] Origin=0.000n 0.000w 0.00a 0.0 Run [Script] var /s_obs, $obs var $min, $day1, $day2, $day3, $day4, $hour var at QueryPos, %IsQuerying var $BoardAct, ~Board, $BoardDes, ~Boarda $BoardAct = "create sign; zxcv" %IsQuerying = 0 $day1=1 $day2=10 $day3=1 $day4=15 $obs = obs1.txt $g = "wavspk.rwx" at k = 0.50n 1.0w 0.50a 270.0 $h = "create sound deport1" Label start GetLocation at QueryPos OnQueryCompleteEvent Complete %IsQuerying = 1 Say Please wait - scanning QueryAt at QueryPos Label WaitForQuery IfInt %IsQuerying = 1 Goto WaitForQuery $BoardDes = "Hello" Say Completed scan GoSub Findboard ~Board = ~Boarda GoSub timeout Label MainLoop Wait 1 Label MainLoop1 GetHour $hour IfString $hour = $day1 Goto MainLoop2 IfString $hour = $day3 Goto MainLoop2 Goto MainLoop1 Label MainLoop2 GetMinute $min IfString $min = $day2 Goto Mainloop3 Else IfString $min = $day4 GoSub delete Else Goto MainLoop1 Goto MainLoop2 Label MainLoop3 IfInt %i = 1 Goto MainLoop SlistLoad /s_obs $obs GetModel ~k $g GetLocation ~k at k GetAction ~k $h ObjectAdd ~k GetObjectNumber %m ~k SListSetField /s_obs model 1 ~k SListSetField /s_obs model 2 %m SlistSave /s_obs $obs %i = 1 GoTo MainLoop Label sign GoSub Findboard ~Board = ~Boarda GoSub timeout ResetTo Mainloop End Sub FindBoard FilterClear ResClear FilterAction $BoardAct ResFromSurveyFilter IfGetResObjectItem ~Board 1 GoSub Makeboard EndSub Sub MakeBoard ~Boarda = ~Board IfString $BoardDes = "Hello" $BoardDes = "Welcome" Else IfString $BoardDes = "Welcome" $BoardDes = "Hello" Say $BoardDes GetDescription ~Boarda $BoardDes ObjectModify ~Board ~Boarda EndSub Event Complete %IsQuerying = 0 EndEvent Sub timeout ClearTimeouts OnTimeoutEvent Timeout GetDateTime !d AddMinutes !e !d 1 SetTimeout !e EndSub Event Timeout GetTimeout !e ResetTo sign EndEvent Sub delete SlistLoad /s_obs $obs SListGetField /s_obs model 1 ~m SListGetField /s_obs model 2 %m GetObjectNumber ~n %m GetLocation ~n ~m ObjectDelete ~n %i = 0 EndSub [View Quote] > Could someone please give me a hand with a simple Xelogot script... either > contact me email or t'gram > > I need a script that will create change and delete objects based on the time > of day > > eg... > > at 1:10pm create a wavspk > at 1:15pm delete same wavspk > > at 1 minute intervals change sign3 to alternate display from "Hello" to > "Welcome" and back > > Thanks, Justin (user: Just In, justefyde at hotmail.com) > > > just inDec 20, 2001, 11:06pm
Thankyou Who :o)
So much for thinking it was going to be "simple" - Sheesh what a lot of code! If there are any refinements please let me know. Regards, Justin PS: With only one exception, I have no "blacklist". [View Quote] whoDec 21, 2001, 9:57am
Hi,
The code could be simplified quite a bit. The use of "IsBetween" statements for the time and the negation of saving the speaker object to a file would trim it a fair bit. But as i said, it was tacked together from pieces of existing script - I didn't write one from scratch :) Also the idea of saving the speaker object to a file is to negate connection problems etc. Normally if a bot disconnects or something it will forget where it placed an object, saving the relative info of the object to a file means that the bot could be reactivated a week later and the file would tell it what the object is and where. In your case its not that useful as the speaker is only there 5 minutes a day. But if you decide to add many other objects created at other times then it would become useful. As to your New Years idea (sent via email) you can just add to the script. The variables for the objects created can be stored in a file and the bot can read it in at a particular time and build it. This actually the same as what is done with the speaker, only it loads multiple objects. Save your NY fireworks etc as a project and just get the bot to load it in and build it, and then afterwards it deletes it. Remember the bot has to also save the build success list after creating the objects. This is much like an earlier post I replied to about filtering objects. Some example of loading a project and saving the build result: OnProjectCompleteEvent complete Label Build ClearLists ProjectClear ProjectLoad $f ProjectBuildED Label Loop GoTo Loop Label carryon SaveListAS $s Say constructed.... Wait 120 Say Ok thats enough of that..... ProjectLoad $s ClearLists ProjectDestroyED Say Thats it, test complete.. End Event complete ResetTo carryon EndEvent $f is the name of your file you made of the stuff. $s is a name you give to the save file for the build success list. You could easily add the above and activate it with another time control. [View Quote] > Thankyou Who :o) > > So much for thinking it was going to be "simple" - Sheesh what a lot of > code! If there are any refinements please let me know. > > Regards, Justin > > PS: With only one exception, I have no "blacklist". > [View Quote] > |