Advertisement
Guest User

FcBot Hello World

a guest
Sep 11th, 2011
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.24 KB | None | 0 0
  1. using System;
  2. using System.Text;
  3.  
  4. using FcCore.Engine;
  5. using FcCore.Subspace;
  6. using FcCore.Subspace.Modules;
  7.  
  8. namespace FcCore.Fc.Modules
  9. {
  10.     public class HelloWorld : IFcEngineModule
  11.     {
  12.         IArena arena;   //Arena module holder
  13.         IChat chat;     //Chat module holder
  14.  
  15.         //Called when the engine loads the module
  16.         //Return true if this module can be loaded successfully otherwise false.
  17.         bool IFcEngineModule.OnLoad(IFcEngineHook engineHook)
  18.         {
  19.             if (engineHook.AttachModule<IArena>(out arena))
  20.             {
  21.                 //Event ArenaEntered hookup
  22.                 arena.ArenaEntered += new ArenaEnteredHandle(arena_ArenaEntered);
  23.                 if (engineHook.AttachModule<IChat>(out chat))
  24.                     return true;
  25.             }
  26.             return false;
  27.         }
  28.  
  29.         //Called when the engine unloads the module
  30.         //Return true if this module can be unloads successfully otherwise false.
  31.         bool IFcEngineModule.OnUnload(IFcEngineHook enghineHook)
  32.         {
  33.             return true;
  34.         }
  35.  
  36.         void arena_ArenaEntered(object sender, ushort playerId)
  37.         {
  38.             chat.SendPublic("Hello World!", SoundType.Fart);
  39.         }
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement