Xelagot script by Who 230147


Project Save Script - Voice activated

Script
This script allows you to save your build by answering the bot with the relative information. It is important to edit the script and understand what the bot asks of you.
[Head]
Type=Script
Version=2.0

[Settings]
Origin=0.000n 0.000w 0.00a 0.0°

[Script]
# by Who, 230147 modified/created July 2000
# NOTE: You must edit and place your citname in the $z = ???? field. This is necessary so the
# bot listens only to YOU and not others around when it asks for coords etc
# Don't say the wrong thing in the answer! - if you do, restart the script
# %c contains the citizen number - vocally given
# $f contains the filename to save - vocally given
# The variables @a and @b have the coordinates of the opposite corners NW/SE of the area - vocally given
OnQueryBeginEvent QB
OnQueryCompleteEvent QC

$z = Who  # <--- put your citname here

Label begin
 Sayconcat "Ready to proceed " $z
 OnChatEvent Chat
 Whisper $z State citizen number of project build eg: 123456
 Label cit1
 goto cit1
 Label cit2
 %c = $a
 Whisperconcat $z $a " is the citizen number to be used"
 Label title
 OnChatEvent Chat1
 Whisper $z State filename of project eg: myproject.txt
 Label title1
 goto title1
 Label title2
 $f = $b
 Whisperconcat $z $b " is the filename to be used"
 Label coord
 OnChatEvent Chat2
 Whisper $z State coords at NW corner eg: 20n 20w
 Label coord1
 goto coord1
 Label coord2
 @a = $l
 Whisperconcat $z @a " is the NW corner"
 Label coord3
 OnChatEvent Chat3
 Whisper $z State coords at SE corner eg: 20s 20e
 Label coord4
 goto coord4
 Label coord5
 @b = $m
 Whisperconcat $z @b " is the SE corner"
 OnChatEvent
 IfLoc @a IsWestOf @b
 Else Goto WrongCoords
 IfLoc @a IsNorthOf @b
 Else Goto WrongCoords
Label start
 %i = 1
 Whisper $z Searching, looking for builds...
 FilterClear
 FilterCitizen %c
 GetAltitude @a 350
 GetRotation @b 180
 LocMove3D @b 0.01 0.0
 LocMove3D @b 0.01 90.0
 GetAltitude @b -350 
 FilterNorthWestHigh @a
 FilterSouthEastLow @b
 ProjectClear
 ProjectBackup @a @b %r
 Label Loop
 IfInt %i <= %r Goto Loop
 ResClear
 ResFromProjectFilter
 ResCount %c
 WhisperConcat $z %c " bits counted."
 ProjectClear
 ProjectFromRes
 WhisperConcat $z "Saving " $f 
 ResSave $f
 Goto complete
 Label WrongCoords
 Whisper $z The coords you entered don't appear to be NorthWest and SouthEast
 Whisper $z Please check these coords and enter them again
 Goto coord
Label complete
 Whisper $z All done
End

Event QB
   WhisperConcat $z "Surveying zone " %i " of " %r
EndEvent

Event QC
   inc %i
   IfInt %i > %r Goto QC1
   WhisperConcat $z "Surveying zone " %i " of " %r
   EndEvent
   
   Label QC1
   WhisperConcat $z "Survey of " %r " zones completed. "
   OnQueryBeginEvent
   OnQueryCompleteEvent
EndEvent

Event Chat
  GetChatPerson &p
  GetName $y &p
  GetChatLine $a
  IfString $y <> $z EndEvent
  IfString $a = "" EndEvent
  ResetTo cit2
EndEvent

Event Chat1
  GetChatPerson &p
  GetName $y &p
  GetChatLine $b
  IfString $y <> $z EndEvent
  IfString $b = "" EndEvent
  ResetTo title2
EndEvent

Event Chat2
  GetChatPerson &p
  GetName $y &p
  GetChatLine $l
  IfString $y <> $z EndEvent
  IfString $l = "" EndEvent
  ResetTo coord2
EndEvent

Event Chat3
  GetChatPerson &p
  GetName $y &p
  GetChatLine $m
  IfString $y <> $z EndEvent
  IfString $m = "" EndEvent
  ResetTo coord5
EndEvent

Alternativly you can download the script by selecting this link: projvoc.zip