All pastes #794393 Raw Edit

Anonymous

public text v1 · immutable
#794393 ·published 2007-11-23 02:29 UTC
rendered paste body
* Gale Database 1.0

* Database Setup.-

(0:0) When everything is starting up,

* Clear all variables to Zero.
            (5:399) clear all variables to zero.

* Set the "Lost ID's" array. (To keep track of the ID's that are left when a furre leaves the dream). You can modify the number of "Lost ID's" you want it to track, 30 is default, I doubt 40 furres are gonna leave in a second and 1 has to arrive just after it happened.
      (5:311) use variable %Free_IDs[11] as an array, and set element 0 of it to 0.

* Set the "Data 1" array. (To keep track of one stat per furre in the dream).
      (5:311) use variable %Data_1[11] as an array, and set element 0 of it to 0. (# = Custom Number, number of furres you want to keep in the dream at the same time.)

* Set the "Data 2" array. (To keep track of one stat per furre in the dream).
      (5:311) use variable %Data_2[11] as an array, and set element 0 of it to 0. (# = Custom Number, number of furres you want to keep in the dream at the same time.

* Note: You can add more arrays to this section, but keep in mind that each slot an array uses is a variable, and the variables limit per dream is 500 variables.

* End of Database Setup.

* ID's Managing.-

* Perform a Current Population check.
(0:9) When a furre arrives in the dream,
      (5:318) set variable %Pointer.x to the number of furres in the dream.

* When a furre arrives, and if the population is not higher than the max. desired, AND, there are no Free ID's left by other furres, attach them a newly-made ID.
(0:9) When a furre arrives in the dream,
  (1:200) and variable %Pointer.y is equal to 0,
  (1:202) and variable %Pointer.x is less than 11, (# = Custom Number, number of furres you want to keep in the dream at the same time.)
      (5:304) take variable %Pointer.y and subtract 1 from it.
      (5:316) set the triggering furre's entry code to %Pointer.x.
      (5:200) emit message {#ID's: Welcome [FURRE], your ID was successfully set to %Pointer.x.} to the triggering furre.

* When a furre arrives, and if the population is not higher than the max. desired, AND, there is at least one Free ID left by other furre, attach them the last ID was left.
(0:9) When a furre arrives in the dream,
  (1:201) and variable %Pointer.y is greater than 0,
  (1:202) and variable %Pointer.x is less than 11, (# = Custom Number, number of furres you want to keep in the dream at the same time.)
      (5:310) use variable %Free_IDs as an array, and copy element %Pointer.y of it into variable %Pointer.x.
      (5:311) use variable %Free_IDs as an array, and set element %Pointer.y of it to 0.
      (5:304) take variable %Pointer.y and subtract 1 from it.
      (5:316) set the triggering furre's entry code to %Pointer.x.
      (5:200) emit message {#ID's: Welcome [FURRE], your ID was successfully set to %Pointer.x.} to the triggering furre.

* When a furre arrives, and if the population is HIGHER than the max. desired, let the furre know the dream is full and eject them.
(0:9) When a furre arrives in the dream,
  (1:201) and variable %Pointer.x is greater than 11, (# = Custom Number, number of furres you want to keep in the dream at the same time.)
      (5:200) emit message {#ID's: Welcome [FURRE], but sorry, the dream is full, try again coming later, thanks for visiting!} to the triggering furre.
      (5:78) eject the triggering furre.

* End of ID's Managing.

* Data Managing.-

(0:1) Whenever somebody moves,
(0:4) When a furre turns,
(0:10) When a furre leaves the dream,
(0:15) When a furre uses the get/drop command,
(0:16) When a furre uses any object,
(0:36) When a furre says or emotes anything,
(0:39) When a furre emits anything,
(0:71) When a furre stays in the same square for 1 seconds,
(0:74) When a furre ejects someone from the dream,
(0:81) When a furre clicks any DragonSpeak Button,

* Data Registerer.-

* Update the last triggering furre's stats.
      (5:311) use variable %Data_1 as an array, and set element %Fur_ID.x of it to %Fur_Data_1.x.
      (5:311) use variable %Data_2 as an array, and set element %Fur_ID.x of it to %Fur_Data_2.x.

* End of Data Registerer.

* Furre Data Recopiler.-

* Get the new triggering furre's ID.
      (5:315) set variable %Fur_ID.x to the triggering furre's entry code.

* End of Furre Data Recopiler.

* Data Tracker.-

* Get the new triggering furre's stats and put them into the %Fur_Data variables, these variables can be modified as normal variables, but they update theirselves in the arrays, you can use them to track a furre's gold and such.
      (5:310) use variable %Data_1 as an array, and copy element %Fur_ID.x of it into variable %Fur_Data_1.x.
      (5:310) use variable %Data_2 as an array, and copy element %Fur_ID.x of it into variable %Fur_Data_2.x.

* End of Data Tracker.

* Data Closer.-

(0:10) When a furre leaves the dream,

* When a furre leaves, increase the %Pointer.y (Variable that tracks the number of left apart ID's).
      (5:302) take variable %Pointer.y and add 1 to it.
      (5:311) use variable %Free_IDs as an array, and set element %Pointer.y of it to %Fur_ID.x.

* Clear their data.
      (5:311) use variable %Data_1 as an array, and set element %Fur_ID.x of it to 0.
      (5:311) use variable %Data_2 as an array, and set element %Fur_ID.x of it to 0.
      (5:310) use variable %Free_IDs as an array, and copy element %Pointer.y of it into variable %Temp.x.
      (5:204) emitloud message {[FURRE] has just left, ID = %Fur_ID.x, Stored: %Temp.x, Sum: %Pointer.y } to everyone on the map.

* End of Data Closer.

* End of Gale Database 1.0