Author Topic: Scripting template  (Read 3437 times)

0 Members and 1 Guest are viewing this topic.

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Scripting template
« on: June 02, 2007, 06:42:44 pm »
I reorganized the template a few months ago... ill keep the old one here, but here is the one I use now:
Code: [Select]
procedure ActivateServer();
begin
end;

procedure AppOnIdle(Ticks: integer);
begin
end;

procedure OnMapChange(NewMap: string);
begin
end;

procedure OnException(ErrorMessage: string);
begin
end;

procedure OnAdminConnect(IP: string);
begin
end;

procedure OnAdminDisconnect(IP: string);
begin
end;

procedure OnAdminMessage(IP, Msg: string);
begin
end;

function OnRequestGame(IP: string; State: integer): integer;
begin
  Result := State;
end;

procedure OnJoinGame(ID, Team: byte);
begin
end;

procedure OnJoinTeam(ID, Team: byte);
begin
end;

procedure OnLeaveGame(ID, Team: byte; Kicked: boolean);
begin
end;

function OnCommand(ID: Byte; Text: string): boolean;
begin
  Result := false;
end;

function OnPlayerCommand(ID: Byte; Text: string): boolean;
begin
  Result := false;
end;

procedure OnPlayerSpeak(ID: byte; Text: string);
begin
end;

procedure OnWeaponChange(ID, PrimaryNum, SecondaryNum: byte);
begin
end;

function OnPlayerDamage(Victim, Shooter: byte; Damage: integer): integer;
begin
  Result := Damage;
end;

procedure OnPlayerKill(Killer, Victim: byte; Weapon: string);
begin
end;

procedure OnPlayerRespawn(ID: byte);
begin
end;

procedure OnFlagGrab(ID, TeamFlag: byte; GrabbedInBase: boolean);
begin
end;

procedure OnFlagReturn(ID, TeamFlag: byte);
begin
end;

procedure OnFlagScore(ID, TeamFlag: byte);
begin
end;



I just thought I would share what I use for my scripts. I like having only one file, it seems much easier to manage.
Code: [Select]
procedure OnAdminConnect(IP: string);
begin
end;

procedure OnAdminDisconnect(IP: string);
begin
end;

procedure OnAdminMessage(IP, Msg: string);
begin
end;

procedure ActivateServer();
begin
end;

procedure AppOnIdle(Ticks: integer);
begin
end;

function OnCommand(ID: Byte; Text: string): boolean;
begin
  Result := false;
end;

function OnPlayerCommand(ID: Byte; Text: string): boolean;
begin
  Result := false;
end;

procedure OnException(ErrorMessage: string);
begin
end;

function OnRequestGame(IP: string; State: integer): integer;
begin
  Result := State;
end;

procedure OnWeaponChange(ID, PrimaryNum, SecondaryNum: byte);
begin
end;

procedure OnJoinGame(ID, Team: byte);
begin
end;

procedure OnJoinTeam(ID, Team: byte);
begin
end;

procedure OnLeaveGame(ID, Team: byte; Kicked: boolean);
begin
end;

procedure OnFlagGrab(ID, TeamFlag: byte; GrabbedInBase: boolean);
begin
end;

procedure OnFlagReturn(ID, TeamFlag: byte);
begin
end;

procedure OnFlagScore(ID, TeamFlag: byte);
begin
end;

procedure OnMapChange(NewMap: string);
begin
end;

procedure OnPlayerKill(Killer, Victim: byte; Weapon: string);
begin
end;

function OnPlayerDamage(Victim, Shooter: byte; Damage: integer): integer;
begin
  Result := Damage;
end;

procedure OnPlayerRespawn(ID: byte);
begin
end;

procedure OnPlayerSpeak(ID: byte; Text: string);
begin
end;
« Last Edit: November 08, 2007, 06:27:30 am by DorkeyDear »

Offline chrisgbk

  • Moderator
  • Veteran
  • *****
  • Posts: 1739
Re: Scripting template
« Reply #1 on: June 02, 2007, 08:22:48 pm »
Stickied for great justice.

Offline Kavukamari

  • Camper
  • ***
  • Posts: 435
  • 3.14159265358979, mmm... pi
Re: Scripting template
« Reply #2 on: August 13, 2007, 09:56:17 pm »
any way you could explain all of these codes for the scripting newbies?

(me)
"Be mindful of fame, show a mighty courage, watch against foes. Nor shalt thou lack what thou desirest, if with thy life thou hast comest out from that heroic task."

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Scripting template
« Reply #3 on: August 13, 2007, 10:07:43 pm »
This should no longer be of much use to many people sense the change in the core to v2, which does not require every event to be in scripts.
If you read them, they should be fairly obvious. The ones that aren't so obvious are OnAdminConnect, OnAdminDisconnect, and OnAdminMessage; which relate to admins connecting from external programs (via ARSSE for example), but I can not know that for certain.
If you don't understand anything else, goto http://www.enesce.com/help for a list of these events.

Offline Kavukamari

  • Camper
  • ***
  • Posts: 435
  • 3.14159265358979, mmm... pi
Re: Scripting template
« Reply #4 on: August 14, 2007, 02:04:34 pm »
do you need to change the bytes and strings and ID's in the procedure lines for the script to work?

oh and what is a boolean? I never knew what that was

edit again: do scripts work for "novice" (not rented) dedicated servers? or will I have to rent a pro server
« Last Edit: August 14, 2007, 02:09:32 pm by Kavukamari »
"Be mindful of fame, show a mighty courage, watch against foes. Nor shalt thou lack what thou desirest, if with thy life thou hast comest out from that heroic task."

Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
Re: Scripting template
« Reply #5 on: August 14, 2007, 02:05:53 pm »
They mustn't be changed.
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host

Offline chrisgbk

  • Moderator
  • Veteran
  • *****
  • Posts: 1739
Re: Scripting template
« Reply #6 on: August 18, 2007, 04:40:20 pm »
This should no longer be of much use to many people sense the change in the core to v2, which does not require every event to be in scripts.
If you read them, they should be fairly obvious. The ones that aren't so obvious are OnAdminConnect, OnAdminDisconnect, and OnAdminMessage; which relate to admins connecting from external programs (via ARSSE for example), but I can not know that for certain.
If you don't understand anything else, goto http://www.enesce.com/help for a list of these events.

I'm going to leave it stickied because it's still useful information; although if someone could check over it and make sure that it's up to date it would be appreciated. I'll do it myself later if no one gets around to it though.

Offline Toumaz

  • Veteran
  • *****
  • Posts: 1906
Re: Scripting template
« Reply #7 on: August 18, 2007, 04:55:25 pm »
I'm going to leave it stickied because it's still useful information; although if someone could check over it and make sure that it's up to date it would be appreciated.

Yes, as far as I've compared it with the latest 2.6.2 files the template seems to be up to date and current.

Offline JoeCool

  • Major(1)
  • Posts: 35
  • Watdfuxup?
Re: Scripting template
« Reply #8 on: August 23, 2007, 09:45:53 pm »
NEWB ALERT! how do you accually....use scripts?
[ban] TEH NOOBS

Offline Sunshine

  • Major(1)
  • Posts: 37
Re: Scripting template
« Reply #9 on: October 19, 2007, 09:53:30 am »
with f9 in game ;]

Offline chrisgbk

  • Moderator
  • Veteran
  • *****
  • Posts: 1739
Re: Scripting template
« Reply #10 on: October 19, 2007, 07:58:00 pm »
with f9 in game ;]

Please don't spam and spread deliberately false information, or you'll have another warning added to your existing one.

Offline miketh2005

  • Soldat Beta Team
  • Flagrunner
  • ******
  • Posts: 668
  • What's the URL for www.microsoft.com?
Re: Scripting template
« Reply #11 on: November 07, 2007, 10:33:06 pm »
no pres F10 ingame

j/k ;D
Quote from: 'Ando.' pid='12999178' dateline='1309046898'
My new password is secure as shit :)
Mate, I am not sure Shit is even secured nowadays.

Offline FliesLikeABrick

  • Administrator
  • Flamebow Warrior
  • *****
  • Posts: 6144
    • Ultimate 13 Soldat
Re: Scripting template
« Reply #12 on: November 08, 2007, 08:15:31 am »
no pres F10 ingame

j/k ;D

This user was warned for this post.  When a moderator posts telling someone else not to spam up this topic, it is quite stupid for you to post right after him doing the same thing.
« Last Edit: November 08, 2007, 08:21:40 am by FliesLikeABrick »

Offline miketh2005

  • Soldat Beta Team
  • Flagrunner
  • ******
  • Posts: 668
  • What's the URL for www.microsoft.com?
Re: Scripting template
« Reply #13 on: November 08, 2007, 11:19:43 am »
nooooooooo don't you know what j/k means? I knew I would get warned thats why I put that, everyone knows j/k means "just kidding" meaning don't take me seriously. That's not spam its just a joke, anyway I'll take the warning since I don't disobey the rules no matter what you think of me, but you never said the duration I got warning from 1 day to 3 days to 7 days but no higher then that, no wait I might I got one for 14 days but definitly not higher then that. So whats the duration?
Quote from: 'Ando.' pid='12999178' dateline='1309046898'
My new password is secure as shit :)
Mate, I am not sure Shit is even secured nowadays.

Offline spkka

  • Camper
  • ***
  • Posts: 469
Re: Scripting template
« Reply #14 on: November 08, 2007, 01:03:09 pm »
NEWB ALERT! how do you accually....use scripts?

Check this topic how  to install scripts:
http://forums.soldat.pl/index.php?topic=21468.0