Tutorials..

Pascal Scripting Overview.


   iP Pascal Scripting - Client Scripted Events...

Client side scripts:

   iPInit.pas = Script that runs each time you run iP.
   LoggedOn.pas = Script that runs each time you log on.
   ArriveRoom.pas = Script that runs each time you enter a room.
   MyTalk.pas = Script that runs each time you talk.
   UserTalk.pas = Script that runs each time a user (including you) talks.
   UserMoved.pas = Script that runs each time a user (including you) moves.
   UserLeft.pas = Script that runs each time a user (including you) leaves a room.
   UserEntered.pas = Script that runs each time a user (including you) enters a room.
   NameChanged.pas = Script that runs each time a user (including you) changes their name.
   UserAVChanged.pas = Script that runs each time a user (including you) changes AV.
   WhisperedTo.pas = Script that runs each time a user whispers to you.
   UserBrbOn.pas = Script that runs each time a user (including you) BRBs.
   UserBrbOff.pas = Script that runs each time a user (including you) unBRBs.


   iP Pascal Scripting - Room Script Events...

Room script events:

In iP room scripts consist not of seperate files but of one file which is executed when an event occurs.
These events are parsed in the script itself and acted upon.

EVENT    DESCRIPTION    ARGS
RETalkInwhen you recieve talk from others (or yourself) whats said
RETalkOutwhen you talk whats said
REWhisperInwhen you recieve a whisper from others (or yourself) whats said
REWhisperOutwhen you whisper whats said
RERoomClickevent generated when you click anywhere in the room "X,Y"
RESpotClickevent generated when you click on any spot "spotnumber"
RERoomEnterevent generated when you enter the room RoomName
RERoomExitevent generated when you leave the room RoomName
REScriptDataevents generated by scripts passing data to all clients "Script Data"

The passed Arguments are always in the form of a string.
So for things such as SpotNumber you would need to convert it to a numerical value.
Examples:
   SpotYouClicked := StrToInt(RoomEventArgs);
   X := StrToInt(Copy(RoomEventArgs,1,Pos(',',RoomEventArgs)-1));
   Y := StrToInt(Copy(RoomEventArgs,Pos(',',RoomEventArgs)+1,Length(RoomEventArgs)-Pos(',',RoomEventArgs)));

Here is an example of a room script that does nothing. It shows how the events are handled.

Program DefaultRoomScript;
Var
  RoomEvent : Integer;
  RoomEventArgs : String;
Begin
  RoomEvent:=GetRoomEvent;
  RoomEventArgs:=ScriptArgString;

  Case RoomEvent of

     RETalkIn : Begin
                  {RoomEventArgs = speaker and whats said}
                End; {RETalkIn = when you recieve talk from others (or yourself)}

    RETalkOut : Begin
                  {RoomEventArgs = whats said}
                End; {RETalkOut = when you talk}

  REWhisperIn : Begin
                  {RoomEventArgs = speaker and whats said}
                End; {REWhisperIn = when you recieve a whisper from others (or yourself)}

 REWhisperOut : Begin
                  {RoomEventArgs = whats said}
                End; {REWhisperOut = when you whisper}

  RERoomClick : Begin
                  {RoomEventArgs = "X,Y"}
                End; {RERoomClick = event generated when you click anywhere in the room}

  RESpotClick : Begin
                  {RoomEventArgs = "spotnumber"}
                End; {RESpotClick = event generated when you click on any spot}

  RERoomEnter : Begin
                  {RoomEventArgs = RoomName}
                End; {RERoomEnter = event generated when you enter the room}

   RERoomExit : Begin
                  {RoomEventArgs = RoomName}
                End; {RERoomExit = event generated when you leave the room}

 REScriptData : Begin
                  {RoomEventArgs = "Script Data"}
                End; {REScriptData = events generated by scripts passing data to all clients}

  End;{Case EventKind of }
End.


iP Pascal Script Standard Features.

iP Pascal Script Commands and Functions.

iP Pascal Script Examples.


Tutorials

      

Home