iPchat Tutorials..

Pascal Scripting Overview.


   iP Pascal Scripting - Supported Functions and Features...

Standard Pascal Function definitions:

   Function Abs(E : Extended) : Extended;

        A:=Abs(-2); {A will equal 2}
        A:=Abs(2); {A will equal 2}

   Function Chr(B : Byte) : Char;
        C:=Chr(65); {C will equal 'A'}
        C:=Chr(97); {C will equal 'a'}

   Function Copy(S : String; Indx, Count : Integer) : String;
        S:='Hi There';
        S2:=Copy(S,4,5); {S2 will equal 'There'}

   Function Cos(E : Extended) : Extended;
        E2:=Cos(100);{E will equal 0.8623 (the cosine of 100)}

   Function Date: TDateTime;
        S:=DateToStr(Date); {S would be the current date in string form}

   Function DateToStr(D: TDateTime) : string;
        S:=DateToStr(Date); {S would be the date in string form}

   Function DayOfWeek(Const DateTime: TDateTime) : Word;
        D:= DayOfWeek(Date); {D would be 4 if today was Wednesday (Sunday=1)}

   Procedure Dec(Var I : Integer);
        Indx:=12;
        Dec(Indx);  {Indx would be 11}    
        Inc(Indx);{Indx would be 12 again}

   Procedure DecodeDate(Const DateTime: TDateTime; var Year, Month, Day: Word);
        DecodeDate(Date,Yr,Mn,Dy); {If today was 11/27/06 then Yr=6, Mn=11, Day=27}

   Procedure DecodeTime(Const DateTime: TDateTime; var Hour, Min, Sec, MSec: Word);
        DecodeTime(Now,Hr,Mn,Sc,Ms); {If it was 3:01:02.001 pm then Hr=15, Mn=1, Sc=2, Ms=1}

   Procedure Delete(Var S : String; Indx, Count : Integer);
        S:='The Big Bad Wolf';
        Delete(S,9,4); {S would be 'The Big Wolf'}

   Function EncodeDate(Year, Month, Day: Word) : TDateTime;
       Var
          MyDate : TDateTime;
 
       MyDate:=EncodeDate(1997,11,27);
       S:=DateToStr(MyDate); {S would be '11/27/1997'}

   Function EncodeTime(Hour, Min, Sec, MSec: Word) : TDateTime;
       Var
          MyTime : TDateTime;
 
       MyTime:=EncodeTime(15,0,0,0);
       S:=TimeToStr(MyTime); {S would be '3:00:00 PM'}

   Function FloatToStr(E : Extended) : String;
      Var
         E : Real;
 
      E:=12.4508;
      S:=FloatToStr(E); {S would be '12.4508'}
      E:=9 / 5;
      S:=FloatToStr(E); {S would be '1.8'}

   Function FormatDateTime(Const fmt: string; D: TDateTime) : string;
     Var
         MyDateTime : TDateTime;
 
       MyDateTime:=StrToDate('11/27/06');
       MyDateTime:=MyDateTime+StrToTime('12:45:10 pm');
       S:=FormatDateTime('"Her birthday is on " dddd, mmmm d, yyyy, " at " hh:mm AM/PM', MyDateTime);
       {S would be 'Her birthday is on Monday, November 27, 2006 at 12:45 PM'}

   Function GetArrayLength(Var u: array) : Longint;
       Var
            AnArray : Array of integer;
 
       AnArray[123]:=4;
       S:=IntToStr(GetArrayLength(AnArray)); {S should equal '123'}

   Procedure Inc(Var I : Integer);
        Indx:=12;
        Inc(Indx); {Indx would be 13}
        Dec(Indx); {Indx would be 12 again}    

   Procedure Insert(Source : String; var Dest : String; Indx : Integer);
        S:='The Big Wolf';
        Insert('Bad ',S,9); {S would be 'The Big Bad Wolf';

   Function IntToStr(I : Longint) : String;
       I:=123;
       S:=IntToStr(I);{S would be '123'}

   Function Length(S : String) : Longint;
        S:='The Big Bad Wolf';
        I:=Length(S); {I would be 16}

   Function Lowercase(S : String) : string;
        S:='The Big Bad Wolf';
        S2:=Lowercase(S); {S2 would be 'the big bad wolf'}

   Function Now: TDateTime;
       S:='It is now  '+TimeToStr(Now)+' on '+(DateToStr(Date)); {S would look like: 'It is now 12:01 PM on 11/27/06'}

   Function Ord(C : Char) : Byte;
       I:=Ord('A'); {I would be 65}

   Function Padl(S : string;I : longInt) : string;
       S:='123';
       S2:=Padl(S,12); {S2 would have 12 spaces before the 123}

   Function Padr(S : string;I : longInt) : string;
       S:='123';
       S2:=Padr(S,12); {S2 would have 12 spaces after the 123}

   Function Padz(S : string;I : longInt) : string;
       S:='123';
       S2:=Padz(S,12); {S2 would have 12 zeros before the 123}

   Function Pi : Extended;
       S:=Copy(FloatToStr(pi),1,6); {S='3.1415'}

   Function Pos(SubStr, S : String) : Integer;
       I:=Pos('Big','The Big Bad Wolf'); {I=9}

   Function Replicate(C : Char;I : longInt) : string;
      S:=Replicate('A',6); {S would be 'AAAAAA'}

   Function Round(E : Extended) : Longint;
      I:=Round(Pi); {I would be 3}
      I:=Round(3.6); {I would be 4}

   Procedure SetLength(Var S: String; L: Longint);
      S:='The Big Bad Wolf';
      SetLength(S,7); {S would be 'The Big'}

   Function Sin(E : Extended) : Extended;
      Var
         E : Real;
 
       E:=Sin(12);
       S:=Copy(FloatToStr(E),1,6);{S='0.536'}

   Function Sqrt(E : Extended) : Extended;
       Var
          E : Real;
 
       E:=Sqrt(9); {E would be 3.0}

   Function StrGet(S : String; I : Integer) : Char;
       S:='4567';
       S2:=StrGet(S,3); {S2 would be '6'}

   Function StringOfChar(C : Char;I : longInt) : string;
       S:=StringOfChar('A',6); {S would be 'AAAAAA'}

   Function StrSet(C : Char; I : Integer; Var S : String) : Char;
      Var
          MyDate : TDateTime;
 
       MyDate:=StrToDate('11/27/2006); 

   Function StrToDate(Const s: string) : TDateTime;
      Var
          MyDate : TDateTime;
 
       MyDate:=StrToDate('11/27/2006); 

   Function StrToInt(S : String;Def : Longint) : Longint;
      S:='123';
       I:=StrToInt(S); {I would be 123}

   Function StrToIntDef(Const S: string; Def: LongInt) : LongInt; {Converts a string to an integer.}
       S:='hi there';
       I:=StrToIntDef(S, 1); {I would be 1}
       S:='123';
       I:=StrToIntDef(S, 1); {I would be 123}

   Function Time: TDateTime;
       S:='The time is '+TimeToStr(Time);

   Function Trim(S : String) : String;
       S:=' This has a space in front and behind ';
       S2:=Trim(S); {S2 would be 'This has a space in front and behind'}

   Function Trunc(E : Extended) : Longint;
       Var
         E : Real;
 
       E:=2.34;  
       I:=Trunc(E); {I would be 2}
       I2:=Round(E); {I2 would be 2}
 
       E:=2.98;  
       I:=Trunc(E); {I would be 2}
       I2:=Round(E); {I2 would be 3}

   Function TryEncodeDate(Year, Month, Day: Word; out Date: TDateTime) : Boolean;
       B:=TryEncodeDate(2006,11,27,MyDateTime); {B should be true}

   Function TryEncodeTime(Hour, Min, Sec, MSec: Word; out Time: TDateTime) : Boolean;
        B:=TryEncodeTime(15,10,01,00,MyDateTime); {B should be true}

   Function Uppercase(S : String) : string;
        S:='The Big Bad Wolf';
        S2:=Uppercase(S); {S2 would be 'THE BIG BAD WOLF'}

iP specific Function definitions:

   Procedure ActivateBrowser(BrowserNumber,X,Y,W,H : Integer; URL : String);

         ActivateBrowser(1,0,0,320,200,'http://www.ipalaces.net'); {sets webspot #1 to 0,0,319,199 and loads up the iP web site}

   Procedure AddAVFrame;
        If  MyPropsNumber<16 then  AddAVFrame; {adds a blank prop ('frame') to your av}

   Function Args(Num : Integer) : String; {args[x].. Args[0]=# of args passed as a string}
        S:=Args[2]; {S now contains the 2nd word passed to the script}     

   Procedure ClearAVFrame(Frame : Integer);
         ClearAVFrame(2); {clears the 2nd prop in your av}

   Procedure ClearGlobalBoolean(Name : String);
        ClearGlobalBoolean('Playing'); {removes the global boolean 'Playing' from the global boolean list}

   Procedure ClearGlobalChar(Name : String);
        ClearGlobalChar('KeyPressed'); {removes the global character 'KeyPressed' from the global char list}

   Procedure ClearGlobalInteger(Name : String);
        ClearGlobalInteger('Score'); {removes the global Integer 'Score' from the global Integer list}

   Procedure ClearGlobalLongInt(Name : String);
        ClearGlobalLongInt('Round'); {removes the global LongInt 'Round' from the global LongInt list}

   Procedure ClearGlobalReal(Name : String);
        ClearGlobalReal('Total'); {removes the global Real 'Total' from the global Real list}

   Procedure ClearGlobalString(Name : String);
        ClearGlobalString('Player'); {removes the global String 'Player' from the global string list}

   Procedure ClearGlobalWord(Name : String);
        ClearGlobalWord('Height'); {removes the global Word 'Height' from the global Word list}

   Procedure ClearHighScores;
         ClearHighScores; {Clears the high scores structure}

   Procedure ClearSprite(SpriteNumber : Integer);
         ClearSprite(12); {removes the user's sprite #12 from view}

   Procedure ClearSprites;
         ClearSprites; {removes all of the user's sprites from view}

   Function ClientVersion : String;
         S:=ClientVersion; {S contains the version of the client that the user is using}

   Procedure CreateSpriteByID(SpriteIDHash : String; SpriteNumber : Integer);
         CreateSpriteByID('ABCD00123456789',4); {Assigns the .blb with hash 'ABCD00123456789' to blob #4}

   Procedure CreateSpriteByName(SpriteName : String; SpriteNumber : Integer);
         CreateSpriteByName('ufo',3); {Assigns 'ufo.blb' to blob #3}

   Procedure DeActivateBrowser(BrowserNumber : Integer);
         DeActivateBrowser(2); {Hides browser (web spot) #2}

   Procedure DlButDontPlayMedia(S:String);
         DlButDontPlayMedia('applause.wav'); {downloads applause.wav from the server but does not play it}

   Function EscapeWasPressed : Boolean;
         Repeat
           .... do some stuff ...
         Until EscapeWasPressed;

   Function GetAVFrameIDHash(Frame : Integer) : String;
         S:=GetAVFrameIDHash(1); {S now holds the PropID for prop #1 of the user's av}

   Procedure GetAVPixel(Var Frame, X, Y, R, G, B, A : Integer);
         GetAVPixel(1,XX,YY,R,G,B,A); {R, G, B and A now contain the values of the pixel at XX, YY in prop 1 of the user's AV}

   Function GetBlobId(SpriteName : String) : String;
         S:=GetBlobId('ufo.blb'); {opens 'ufo.blb' and reads its ID hash}

   Function GetByToken(I: Integer; Token, Str : String) : String;
         S:=GetByToken(I,'lives=',S2); {begins searching for 'Lives=' in S2 at position I returns the text between 'lives=' and the next space it encounters}

   Function GetGlobalBoolean(Name : String) : Boolean; {If undefined it defaults to False}
         If GetGlobalBoolean('Playing')=False then SendTextToLog('Game Over'); {Retrieves the global boolean 'playing' and if it is false, says Game Over in the log.}

   Function GetGlobalChar(Name : String) : Char; {If undefined it defaults to #0}
         C:=GetGlobalChar('Keypressed'); {sets C to the value of the global char named 'Keypressed'}

   Function GetGlobalInteger(Name : String) : Integer; {If undefined it defaults to 0}
         MyScore:=GetGlobalInteger('Score'); {sets MyScore to the value of the global integer named 'Score'}

   Function GetGlobalLongInt(Name : String) : LongInt; {If undefined it defaults to 0}
         CurrentRound:=GetGlobalLongInt('Round'); {sets CurrentRound to the value of the global longint named 'Round'}

   Function GetGlobalReal(Name : String) : Double; {If undefined it defaults to 0}
         Total:=GetGlobalReal('Grand Total'); {sets Total to the value of the global real named 'Grand Total'}

   Function GetGlobalString(Name : String) : String; {If undefined it defaults to ''}
         S:=GetGlobalString('Player Name'); {Sets S to the value of the global string named 'Player Name');

   Function GetGlobalWord(Name : String) : Word; {If undefined it defaults to 0}
         N:=GetGlobalWord('NumPlayers'); {Sets N to the value of the global word named 'NumPlayers'}

   Function GetHighScoresName : String;
         S:=GetHighScoresName; {S holds the name of the game from the high scores structure}

   Function GetMaxPhraseRec(FName : string): Integer;
         I:=GetMaxPhraseRec('game phrases'); {I holds the value for the last record in the phrase file named 'game phrases' on the user's computer}

   Function GetMaxQuizRec(FName : string) : Integer;
         I:=GetMaxQuizRec('Turbulent Trivia'); {I holds the value for the last record in the quiz file named 'Turbulent Trivia' on the user's computer}

   Function GetMaxUserRec(FName : string): Integer;
         I:=GetMaxUserRec('mydata');{I holds the value for the last record in the user data file named 'Turbulent Trivia' on the user's computer}

   Function GetMouseY : Integer;
         mY:=GetMouseY; {mY holds the Y value for the mouse location at the moment}

   Function GetMouseX : Integer;
         mX:=GetMouseX; {mX holds the X value for the mouse location at the moment}

   Function GetRoomCount : Integer;
         I:=GetRoomCount; {I holds the # of visitors to the room}

   Function GetUserByName(Name : String) : Integer;
         I:=GetUserByName('Dan'); {I holds the room user # for the user named 'Dan'}

   Function GetUserID (UsersName : String) : String;
        S:= GetUserID ('Dan'); {S holds the ID hash for the user named 'Dan'}

   Function GetUserName(I : Integer) : String;
         S:=GetUserName(I); {S holds the name of room user # I}

   Function GetUserX(S : String) : Integer;
         XX:=GetUserX('Dan'); {XX holds the X location of the room user named 'Dan'}

   Function GetUserY(S : String) : Integer;
         YY:=GetUserY('Dan'); {YY holds the Y location of the room user named 'Dan'}

   Function GetUserZ(User : Integer) : Integer;
         ZZ:=GetUserZ('Dan'); {ZZ holds the Z location of the room user named 'Dan'}

   Procedure GoNaked;
         GoNaked; {Removes all the props from the user's AV}

   Procedure GotoRoomNumber(Room : Word);
         GotoRoomNumber(0); {sends the user to room number 0 (usually the gate)}

   Procedure GotoURLNumber(Number : Word);
         GotoURLNumber(1); {Sends the user to the URL #1 as defined by the room they are in}

   Procedure GotoURL(URL : String);
         GotoURL('http://www.ipalaces.net'); {Sends the user to the iP web site}

   Function IAmStaff : Boolean;
         If IAmStaff Then SendTextToLog('You are currently empowered');

   Function IsABuddy(UserName : String) : Boolean;
         If IsABuddy('Dan') then SendTextToLog('Dan is a buddy'); {checks against your defined buddies to see if 'Dan' is one of them}

   Function LastRoomName : String;
         SendTextToLog('The last room you were in was '+LastRoomName);

   Function LastServerName : String;
         SendTextToLog('You just left '+LastServerName);

   Procedure MoveMeTo(X,Y : Integer);
         MoveMeTo(123,45); {Moves the user to 123 x 45 in the room}

   Function MYName : String;
         If MyName='Dan' then SendTextToLog('Welcome Dan') else SendTextToLog('You are signed in as '+MyName);

   Function MyProps : String;
         SendTextToLog('The props I have on are: '+MyProps);

   Function MyPropsNumber : Integer;
         SendTextToLog('I have '+IntToStr(MyPropsNumber)+' props on');

   Function MyUserNumber : Integer;
         If MyUserNumber=0 then SendTextToLog('I am the first person in the room');

   Procedure NotifyAVChange;
         NotifyAVChange; {sends a notice to the server that your AV has changed}

   Function NumUsersInRoom : Integer;
         SendTextToLog('There are '+IntToStr(NumUsersInRoom)+' users in the room.')

   Function NumUsersOnServer : Integer;
         SendTextToLog('There are '+IntToStr(NumUsersOnServer)+' users on the server.')

   Procedure Page(S : String);
         Page('Hi my name is '+MyName+' and I just arrived from '+LastServerName+' thanks for letting me visit'); {sends a page to the server and staff}

   Procedure PauseFor(Ms : Cardinal);{Pauses for ms miliseconds}
         PauseFor(500); {pauses script execution for half a second (500 miliseconds)}

   Procedure PlayMid(S:String);
         PlayMidi('YouWon.mid'); {Plays a midi file}

   Procedure PlayMP3(S:String);
         PlayMP3('HappyBirthday.mp3'); {if 'HappyBirthday.mp3' exists on the users computer in one of his defined mp3 folders, the mp3 will play for them ouside of iP in whichever program windows defaults to for mp3s}

   Procedure PlayRandomMp3(S:String);
         PlayRandomMp3('beatles'); {if any mp3s exist on the users computer in one of their defined mp3 folders with 'beatles' in the name, then a random one of the so named mp3s will play for them ouside of iP in whichever program windows defaults to for mp3s}

   Procedure PlayWAV(S:String);
         PlayWav('youlost.wav'); {Plays a wav file}

   Procedure PlayWAVLocal(S:String);
         PlayWAVLocal('youlost.wav'); {Plays a wav file locally so that only the user can hear it}

   Function RandomInt(I : Integer) : Integer; {returns 0 to I-1}
         X:=RandomInt(12); {X will be a number from 0 to 11}

   Function ReadAPhraseRec(FName : string; I : Integer; Var Phrase, Hint : String; Var Kind, Pts : Integer) : Boolean;
         ReadAPhraseRec('Animals',RecNum,PS,HS,K,Points); {reads phrase record # RecNum from the 'Animals' phrase file.}

   Function ReadAQuizRec(FName : string; I : Integer; Var Q, A1, A2, A3, A4 : String; Var QType, Pts : Integer) : Boolean;
         ReadAQuizRec('SuperTrivia',RecNum, Question, Answer1, Answer2, Answer3, Answer4, Qt,Points); {reads Quiz record # RecNum from 'SuperTrivia'}

   Function ReadAUserRec(FName : string; I : Integer; Var Name, Date, Status, Data : String; Var Level, Round, Rank, Team, Score : Integer) : Boolean;
         ReadAUserRec('mydata',1,SN,SS,SD,L,Round,Rank,Team,Score); {Reads User Record # 1 from 'mydata'}

   Function ReadHighScores(GameName : String): String;
         S:=ReadHighScores('SuperTrivia');

   Procedure RequestHighScores(GameName : String);
         RequestHighScores('SuperTrivia'); 

   Procedure RoomBrightness(I : Integer);
         RoomBrightness(255); {fully bright}
         RoomBrightness(0);   {totally dark}

   Function RoomName : String;
         SendTextToLog('You are now in '+RoomName);

   Function RoomNumber : Integer;
         SendTextToLog('This is room number '+IntToStr(RoomNumber));

   Procedure RoomTalk(S: String);
         RoomTalk('Hi  '+MyName+' welcome'); {Makes the upper left corner of the room speak}

   Procedure SaveAVFrameToPropSet(Frame : Integer);
         SaveAVFrameToPropSet(I); {Saves prop #I of your AV to your prop set}

   Function ScriptArgString : String;
         If ScriptArgString='hippty hop' then HopABit; {Returns the value of the arguments passed to the script as a string}

   Function SecLevel : Integer;
         SendTextToLog('My security level is '+IntToStr(SecLevel));

   Procedure SendTextToLog(S : String);
         SendTextToLog('The bunnies are attacking, quick get the piggies with the bazookas!'); {Sends text to the log}

   Function ServerName : String;
         S:=ServerName; {returns the name of the server}

   Function ServerVersion : String;
         S:=ServerVersion; {Returns the version of the server}

   Procedure SetAVPixel(Var Frame, X, Y, R, G, B, A : Integer);
         SetAVPixel(1,XX,YY,R,G,B,A); {Sets the pixel at XX, YY in prop #1 to R,G,B, and A}

   Procedure SetGlobalBoolean(Name : String; Value : Boolean); {Up to 128 may be used}
         SetGlobalBoolean('Playing',True); {Sets 'Playing' to true}

   Procedure SetGlobalChar(Name : String; Value : Char); {Up to 128 may be used}
         SetGlobalChar('Keypressed','a'); {Sets 'Keypressed' to 'a'}

   Procedure SetGlobalInteger(Name : String; Value : Integer); {Up to 128 may be used}
         SetGlobalInteger('Score',12); {Sets 'Score' to 12}

   Procedure SetGlobalLongInt(Name : String; Value : LongInt); {Up to 128 may be used}
         SetGlobalLongInt('GrandTotal', 0); {sets 'GrandTotal' to 0}

   Procedure SetGlobalReal(Name : String; Value : Double); {Up to 128 may be used}
         SetGlobalReal('Half', 0.5); {Sets 'Half' to 0.5}

   Procedure SetGlobalString(Name : String; Value : String); {Up to 128 may be used}
         SetGlobalString('Player',MyName); {Sets 'Player' to the user's name}

   Procedure SetGlobalWord(Name : String; Value : Word); {Up to 128 may be used}
         SetGlobalWord('Level',1); {Sets 'Level' to 1}

   Procedure SetHighScores(GameName, Game : String);
         SetHighScores('SuperTrivia',S); {Sets the High scores of 'SuperTrivia' to S}

   Procedure SetMyZ(Z : Integer);
         SetMyZ(0);   {Sets the user's Z to the lowest level}
         SetMyZ(255); {Sets the user's Z to the highest level}

   Procedure SetName(S2 : String);
         SetName(MyName+'(Winner)'); {Sets the user's name to their existing name plus '(Winner)'}

   Procedure SetNameY(Y : Integer);
         SetNameY(100); {Sets the nameY location of the user's av}

   Procedure Setoffset(Spot,State,Dx,DY: Integer);
         Setoffset(1,2,-34,0); {Adjusts where the image for spot state #2 of spot #1 will appear, moving it left by 34 pixels}

   Procedure SetoffsetLocally(Spot,State,Dx,DY: Integer);
         SetoffsetLocally(1,2,-34,0); {Adjusts where the image for spot state #2 of spot #1 will appear, moving it left by 34 pixels but only for this user}

   Procedure SetRoomCount(RoomName : String; RoomCount : Integer);
         SetRoomCount('Gate',1); {Sets the room counter for the room named 'Gate' to 1}

   Procedure SetSpotDelaysLocally(S : String);
       SetSpotDelaysLocally(S); {Sets the spot delays based on a formatted string: 'spot,state,delay|spot,state,delay|'}

   Procedure SetSpotDelays(S : String);
       SetSpotDelays(S); {Sets the spot delays based on a formatted string: 'spot,state,delay|spot,state,delay|'}

   Procedure SetSpotDelay(ISpot,IState,IDelay : Integer);
         SetSpotDelay(1,2,100); {Sets spot 1's state 2 to a delay of 100}

   Procedure SetSpotDelayLocal(ISpot,IState,IDelay : Integer);
         SetSpotDelayLocal(2,3,40); {Sets spot 2's state 3 to a delay of 40}

   Procedure SetSpots(S : String);
         SetSpots(S); {sets a series of spots to states based on a formatted string: 'SpotNumber,State|SpotNumber,State|SpotNumber,State|'}

   Procedure SetSpotsLocally(S : String);
         SetSpotsLocally(S); {sets a series of spots to states based on a formatted string: 'SpotNumber,State|SpotNumber,State|SpotNumber,State|'}

   Procedure SetSpotToState(Spot, State : Word);
         SetSpotToState(2,24); {Sets Spot 2 to state 24}

   Procedure SetSpotToStateLocally(Spot, State : Word);
         SetSpotToStateLocally(1,12); {Sets Spot 1 to state 12}

   Procedure SetSprite(SpriteNumber,SpriteDataNumber,X,Y : Integer);
          SetSprite(12,3,100,200); {sets sprite #12 to Blob #3 and positions it at 100 x 200}

   Procedure SetSprites(S : String);
         SetSprites(S);{format of S=SpriteNumber,SpriteDataNumber,X,Y,Z|SpriteNumber,SpriteDataNumber,X,Y,Z|...}

   Procedure SetSticky(X,Y : Integer);
         SetSticky(112,190); {Sets the sticky ballon talk location of the user}

   Procedure SetTalk(X,Y : Integer);
         SetTalk(112,45); {Sets the talk ballon location of the user}

   Procedure SetThink(X,Y : Integer);
         SetThink(112,25); {Sets the think talk ballon location of the user}

   Procedure Spoof(User, Speach : String);
         Spoof('Dan','Do you have any cute single sisters?'); {Makes it appear as if 'Dan' asked if you have any cute single sisters}

   Procedure SpoofL(X,Y : Integer ;Speach : String);
         SpoofL(123,450,'Hi Katie!'); {makes it appear locally as if someone spoke at 123 x 450 and said 'Hi Katie!');

   Procedure SpoofM(X,Y : Integer ;Speach : String);
          SpoofM(123,450,'Hi Kim!'); {makes it appear as if someone spoke at 123 x 450 and said 'Hi Kim!');

   Function SpotHasWhatState(Spot : Word) : Word;
         I:=SpotHasWhatState(12); {sets I to the spot state # of spot # 12}

   Procedure SpriteXYZ(SpriteNumber,SpriteDataNumber,X,Y,Z : Integer);
         SpriteXYZ(1,4,34,123,128); {Sets sprite #1 to blob #4 and places it at 34 x 123 and in Z layer 128}

   Procedure SpritesXYZ(S : String);
         SpritesXYZ(S); {Sets a series of sprites based on a formatted string}{format of S=SpriteNumber,SpriteDataNumber,X,Y,Z|SpriteNumber,SpriteDataNumber,X,Y,Z|...}

   Procedure StartVideo;
         StartVideo; {If the room has a video it makes the video start playing}

   Procedure StopMid;
         StopMid; {If a midi is playing it attempts to stop it}

   Procedure StopVid;
         StopVid; {if the room has a video playing it stops it}

   Procedure StopWav;
         StopWav; {If a wav is playing it stops it}

   Function TimeToString(T : TDateTime) : String;
         S:=TimeToString(Now); {Sets S equal to the time in string format}

   Procedure Talk(S: String);
         Talk('Hi everyone, my name is '+MyName+' and its nice to meet you all'); {Makes your AV speak}

   Function UserUnderMouse : Integer;
         I:=UserUnderMouse; {if there is a user positioned below where your mouse is it returns their #}

   Procedure WearAVMacro(Number : Integer);
         WearAVMacro(1); {Places the F1 av macro on the user}

   Function WearPropByID(S : String) : Boolean;
         WearPropByID('ABCD12345608971'); {places a prop on the user based on its ID}

   Function WearPropByName(Prop : String) : Boolean; {do not include '.prp'}
         WearPropByName('large cat'); {places a prop on the user based on its name, it must reside in iP's main folder}

   Function WearPropsByID(S : String) : Boolean;
         WearPropsByID(S); {Places a series of props on the user fomated like  'id|id2|id3|'}

   Procedure WHISPERTO(UsersName, S: String);
         WHISPERTO('Dan','Thats an UGLY cat!');

   Function WhoSpoke : String;
         S:=WhoSpoke; {S is the name of the user that spoke, or otherwise triggered the script event}

   Function WhatTheySaid : String;
         S:=WhatTheySaid;{what the person said}

   Function WriteAPhraseRec(FName : string; I : Integer; Phrase, Hint : String; Kind, Pts : Integer) : Boolean;
         WriteAPhraseRec('MyPhrases',23,'Who sang the song "king tut"?','He was ONE wild and crazy guy!',1,10); {adds a phrase record to the 'MyPhrases' file}

   Function WriteAQuizRec(FName : string; I : Integer; Q, A1, A2, A3, A4 : String; QType, Pts : Integer) : Boolean;
         WriteAQuizRec('SuperTrivia',RecNum,SQ,A1,A2,A3,A4,1,20); {adds a record to the 'SuperTrivia' file}

   Function WriteAUserRec(FName : string; I : Integer; Name, Date, Status, Data : String; Level, Round, Rank, Team, Score : Integer) : Boolean;
         WriteAUserRec('MyData',RecNum,MyName,DateToString(Date),'Acrive',GameData,1,14,1,1,1340);

Room Script Only Commands:

   Procedure BlendWithImage(ImgNum, X, Y : Integer; R, G, B, A : Byte);

         BlendWithImage(0,XX,YY,R,G,B,A); {Blends a pixel of the value of R,G,B,A to the room image (ImgNum = 0 is the Room Image, ImgNum =1 and up are the spot images}

   Procedure BlobToImage(ImgNum, BlobNum, X, Y : Integer);
         Procedure BlobToImage(0,1,XX,YY); {copys blob #1 to the room image at XX x YY}

   Procedure ClearRoomSprite(SpriteNumber : Integer);
         ClearRoomSprite(1); {moves room sprite #1 off screen}

   Procedure ClearRoomSpriteLocal(SpriteNumber : Integer);
         ClearRoomSpriteLocal(1); {moves room sprite #1 off screen for the local user only}

   Procedure ClearRoomSprites;
         ClearRoomSprites; {Moves all room sprites off screen for all users}

   Procedure ClearRoomSpritesLocal;
         ClearRoomSpritesLocal; {Moves all room sprites off screen for the local user only}

   Procedure CreateRoomSpriteByID(SpriteIDHash : String; SpriteNumber : Integer); {exposes sprite to server.}
         CreateRoomSpriteByID('ABCDEFG0103013',1); {Sets blob #1 to the blb with the ID hash of 'ABCDEFG0103013'}

   Procedure CreateRoomSpriteByIDLocal(SpriteIDHash : String; SpriteNumber : Integer); {exposes sprite to server.}
         CreateRoomSpriteByIDLocal('ABCDEFG0103013',1); {Sets blob #1 to the blb with the ID hash of 'ABCDEFG0103013'}

   Procedure CreateRoomSpriteByName(SpriteName : String; SpriteNumber : Integer);
         CreateRoomSpriteByName('ufo',1);{Sets blob #1 to 'ufo.blb'}

   Procedure DrawLine(ImgNum, X, Y, X2, Y2 : Integer; R, G, B, A : Byte);
         DrawLine(0,XX,YY,XX2,YY2,R,G,B,A); {draws a line on the room image}

   Procedure DrawPolygon(ImgNum,X,Y : Integer; PolyPoints : String; R,G,B,A : Byte);
         DrawPolygon(0,XX,YY,S,R,G,B,A); {draws a polygon at XX, YY of color/alpha R,G,B,A format of the String: '1,1|12,123|43,144|100,87|32,24|' ('X,Y|X1,Y1|')}

   Procedure DrawRectangle(ImgNum, X, Y, X2, Y2 : Integer; R, G, B, A : Byte);
         DrawRectangle(XX,YY,XX2,YY2,R,G,B,A); {draws a rectangle at XX, YY of color/alpha R,G,B,A}

   Procedure DrawString(ImgNum : Integer; SS : String);
         DrawString(0,S); {Draws to the room image based on a formated string: 'XX,YY,R,G,B,A|XX,YY,R,G,B,A|XX,YY,R,G,B,A|}

   Procedure DrawToImage(ImgNum, X, Y : Integer; R, G, B, A : Byte);
         DrawToImage(0,XX,YY,R,G,B,A); {draws to the room image at XX,YY]

   Procedure GetImagePixelRGB(ImgNum, X, Y : Integer; Var R,G,B,A : Byte);
         GetImagePixelRGB(0,XX,YY,R,G,B,A); {retrieves R, G, B, A for the pixel at XX, YY}

   Function GetJoyStickKey : Word;
         I:=GetJoyStickKey; {retrieves the last key pressed in the joystick control}

   Function GetLabelText(L : Integer) : String;
         S:=GetLabelText(1); {retrieves the text of lable #1}

   Function GetRoomEvent : Integer;
         I:=GetRoomEvent; {retrieves the last room event number}

   Function GetRoomSpriteBlobNumber(SpriteNumber : Integer) : Integer;
         I:=GetRoomSpriteBlobNumber(1);{gets the blob # of sprite #1}

   Function GetRoomSpriteX(SpriteNumber : Integer) : Integer;
         XX:=GetRoomSpriteX(1); {retrieves the X location of the sprite}

   Function GetRoomSpriteY(SpriteNumber : Integer) : Integer;
         YY:=GetRoomSpriteY(1); {retrieves the Y location of the sprite}

   Function GetRoomSpriteZ(SpriteNumber : Integer) : Integer;
         ZZ:=GetRoomSpriteZ(1); {retrieves the Z location of the sprite}

   Procedure HideLabel(L : Integer);
         HideLabel(1); {turns off visibility for label #1}

   Procedure HideLabelLocal(L : Integer);
         HideLabelLocal(1); {turns off visibility for label #1 locally}

   Procedure ImagePixelToPropPixel(ImgNum, ImgX, ImgY, PropX, PropY : Integer);
         ImagePixelToPropPixel(0,XX,YY,PX,PY); {copies the pixel from the image to prop #1 of the AV}

   Procedure ImageRectToProp(ImgNum : Integer; X, Y, X2, Y2 : Integer);
         ImageRectToProp(0,X1,Y1,X2,Y2); {Copies from the image to prop#1of the av starting at 0,0 on the prop}

   Procedure ImageRectToRoomBlob(ImgNum, BlobNum : Integer; X, Y, X2, Y2 : Integer);
         ImageRectToRoomBlob(0,1,XX,YY,XX2,YY2); {copies from an image to a blob}

   Procedure ImageToClipboard(ImgNum : Integer);
         ImageToClipboard(0); {Copies an image to the windows clipboard}

   Procedure ImageToImage(DestImgNum, X, Y, SourceImgNum, SourceX, SourceY, SourceX2, SourceY2 : Integer);
         ImageToImage(0,X,Y,1,X1,Y1,X2,Y2); {copies from an image to another image}

   Function JoyStickShift : Boolean;
         JoyStickShiftKeyIsPressed:=JoyStickShift; {true if the Shift key is pressed in the joystick}

   Function JoyStickCtrl : Boolean;
         JoyStickCtrlKeyIsPressed:=JoyStickCtrl;{true if the Ctrl key is pressed in the joystick}

   Function JoyStickAlt : Boolean;
         JoyStickAltKeyIsPressed:=JoyStickAlt;{true if the Alt key is pressed in the joystick}

   Function JoyStickKeyPressed : Boolean;
         aJoyStickKeyIsPressed:=JoyStickKeyPressed;{true if a key is pressed in the joystick}

   Procedure ReleaseGlobal(Name : String);
         ReleaseGlobal('Playing'); {removes any global variables named 'Playing'}

   Procedure ReleaseAllGlobals;
         ReleaseAllGlobals; {removes all global variable definitions}

   Procedure ReloadRoomImage;
         ReloadRoomImage; {reloads the room image for the local user}

   Procedure ReloadSpotImage(I : Integer);
         ReloadSpotImage(1); {Reloads the spot image for the local user}

   Procedure ReloadSpotImages;
         ReloadSpotImages; {Reloads all spot image for the local user}

   Function RoomSpriteCollision(Sprite1, Sprite2 : integer) : Boolean;
         RoomSpriteCollision(1,2); {does a more exact comparison between sprite#1 and sprite#2 to see if they are touching}

   Function RoomSpriteRectCollision(Sprite1, Sprite2 : integer) : Boolean;
         RoomSpriteRectCollision(1,2);{does a less exact comparison between sprite#1 and sprite#2 to see if their rectangles overlap}

   Procedure RoomSpriteXYZ(SpriteNumber,SpriteDataNumber,X,Y,Z : Integer);
         RoomSpriteXYZ(1,3,XX,YY,ZZ); {positions Room Sprite #1 at XX, YY, ZZ using Room Blob #3}

   Procedure RoomSpriteXYZLocal(SpriteNumber,SpriteDataNumber,X,Y,Z : Integer);
         RoomSpriteXYZLocal(1,3,XX,YY,ZZ); {positions Room Sprite #1 at XX, YY, ZZ using Room Blob #3 locally only}

   Procedure RoomSpritesXYZ(S : String);
         RoomSpritesXYZ(S); {Positions a series of room sprites based on a formatted string: 'Spritenum,BlobNum,X,Y,Z|Spritenum2,BlobNum2,X2,Y2,Z|Spritenum3,BlobNum3,X3,Y3,Z|'}

   Procedure RoomSpritesXYZLocal(S : String);
         RoomSpritesXYZLocal(S); {Positions a series of room sprites locally based on a formatted string: 'Spritenum,BlobNum,X,Y,Z|Spritenum2,BlobNum2,X2,Y2,Z|Spritenum3,BlobNum3,X3,Y3,Z|'}

   Procedure SaveRoomBlob(BlobNumber : Integer; BlobName : String);
         SaveRoomBlob(1,'ufo.blb'); {saves room blob #1 as ufo.blb to the client's blobs folder}

   Procedure SendData(S : String); {used to send data to trigger REScriptData room script event}
         SendData(S); {Sends ANY script defined string value, triggering REScript Data event}

   Procedure ShowLabel(L : Integer);
         ShowLabel(1); {Makes a label visible}

   Procedure ShowLabelLocal(L : Integer);
         ShowLabelLocal(1); {Makes a label visible}

   Procedure SetLabelRGBAZSizeLocal(L,R,G,B,A,Z,Size : Integer);
         SetLabelRGBAZSizeLocal(1,255,255,0,255,0,13); {Makes label #1 yellow and 13 pts in size locally}

   Procedure SetLabelRGBAZSize(L,R,G,B,A,Z,Size : Integer);
         SetLabelRGBAZSize(1,255,255,0,255,0,13); {Makes label #1 yellow and 13 pts in size}

   Procedure SetLabelTextLocal(L : Integer; S : String);
         SetLabelTextLocal(1,'You won!'); {Sets label #1's text to 'You won!' locally}

   Procedure SetLabelText(L : Integer; S : String);
         SetLabelText(1,'You lost!'); {Sets label #1's text to 'You lost!'}

   Procedure SetLabelURL(L,URL : Integer);
         SetLabelURL(1,1); {Sets the target URL of label #1 to URL #1}

   Procedure SetLabelURLLocal(L,URL : Integer);
         SetLabelURLLocal(1,1); {Sets the target URL of label #1 to URL #1 locally}

   Procedure SetLabelXY(L,X,Y : Integer);
         SetLabelXY(1,XX,YY); {Positions Label#1 at XX, YY}

   Procedure SetLabelXYZ(L,X,Y ,Z: Integer);
         SetLabelXYZ(1,XX,YY,ZZ); {Positions Label#1 at XX, YY, ZZ}

   Procedure SetLabelXYZLocal(L,X,Y,Z : Integer);
         SetLabelXYZLocal(1,XX,YY,ZZ); {Positions Label#1 at XX, YY, ZZ locally}

Updated 8/17/06


iP Pascal Script Standard Features.

iP Pascal Script Examples.

iP Pascal Script Client Sided Event Scripts.


Tutorials

      

Home