Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

example.ref 3.37 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
; Script file EXAMPLE.REF, indexed by REFINDEX v0.01 on Sun Mar 18 22:19:16 2001

@DECLARE start 000001181
@DECLARE nomore 000003293
@NOCHECK
; End of .REF index

; Afraid of using vars that LORD2 or other IGM's might change?  No prob!
; use your OWN vars!! The new @data commands make it easy and simple!

; example of how to use the @data command set to easily create your own
; data file to check if a person had been in here that day already.
; by Seth A. Robinson, 6-24-97

; ok, we'll call it 'the magic rock', it says something clever if a user
; pushes against it (it runs this file) but only ONCE per day.. if they
; they have already got their 'wisdom' for the day, it says go away.

; this is a good example because this probably how most people will use
; the @data commands, just to see if someone has been here or not today.  But
; don't forget it is 200 longints that could be used in other ways too, for
; instance, a bank of your own, etc.

; another note.. this .ref *IS* used in the game itself so don't delete it!!
; you could change it and see how it changes in the game though, the 'magic
; rock' is located in Greentree.

@#START
@do moveback
; first we move them back, so they are not standing on the rock

@datanewday rock.idf

; the above command will reset all #'s in ROCK.IDF to 0 *IF* a new day has
; occured since the last time this command was called.

; use idf so it is easy for sysops to know which data files they can delete
; safely  (IGM DATA FILE)

@dataload rock.idf &playernum `p20

; the above command is important - this is how you retrieve ALL data.
; &playernum is the current players # in the trader.dat file, and `p20 is
; a scratch var that we want to put the return result in.

@if `p20 not 1 then do
  @begin

  ; woohoo, they have not been here yet today!
  ; lets spew some wisdom.

  @do `p21 random 10 1
  ; now `p21 is a random # between 1 and 10

  @if `p21 is 1 then saybar
`0Magic Rock: `2Don't eat poison much.
  @if `p21 is 2 then saybar
`0Magic Rock: `2My sources say yes.
  @if `p21 is 3 then saybar
`0Magic Rock: `2Barak is guilty!  But you must prove it.
  @if `p21 is 4 then saybar
`0Magic Rock: `2You must learn to love yourself before you can love others.
  @if `p21 is 5 then saybar
`0Magic Rock: `2You must be very evil to be taken to Dragon Island...
  @if `p21 is 6 then saybar
`0Magic Rock: `2Making LORD2 IGM's is very easy.  Anyone can do it.
  @if `p21 is 7 then saybar
`0Magic Rock: `2There is a `%Moonstone`2 hidden in a waterfall.
  @if `p21 is 8 then saybar
`0Magic Rock: `2The Smackrod could help you break into Sosen Inn...
  @if `p21 is 9 then saybar
`0Magic Rock: `2Nice people have to pay more to get into Bonetown.
  @if `p21 is 10 then saybar
`0Magic Rock: `2If someone places a bounty on your head, your dead.

  @datasave rock.idf &playernum 1

  ; the above is IMPORTANT - we just set this persons data # to 1, now we
  ; will know that he was here!  Until the next day, when it is reset to 0.

  ; all done let's do a @closescript so it will quit right now

  @closescript
  @end

; if we got here, it means they HAVE been on today.

@do saybar
`2The strange rock refuses to speak again.

; all done!

@#NOMORE

; always put this at an end of a .ref file.. when it sees the @# it knows
; that the routine it was sent to do is over.  a @closescript works too.