Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > Code Gallery
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-22-2011, 03:04 AM
furry_mougle furry_mougle is offline
big heart
furry_mougle's Avatar
Join Date: Aug 2011
Posts: 42
furry_mougle is an unknown quantity at this point
Typewriter

Feel free to critique, not sure if it's "code" gallery material (probably not, but might be interesting to have up regardless) . I haven't seen a typewriter script up yet though. Pretty much the same thing on UN (not leeched though).

PHP Code:
//#CLIENTSIDE
function onKeyPressed(code) {
  if (
keydown(8) || temp.code == && this.on){
   
setTimer(0.05); // checking if pressed && looping
  
} else {
   
setTimer(0);
  }
}

function 
onTimeout() {
  if (
ChatBar.visible && this.on) { // if chatbar visible && on
   
temp.text ChatBar.text// define var
    
if (temp.text != null) {
     
player.chat temp.text// send player.chat directly, looping
    
}
  
setTimer(0.05);
  }
}

function 
onWeaponFired(){ 
  if (!
this.on){  
    
this.on true;
    
player.chat "Typewriter on!"// aesthetics 
  
}else if(this.on){
    
this.on false;
    
player.chat "Typewriter off!";
  }

EDIT: Oops, was looping for no real good reason.

PHP Code:
//#CLIENTSIDE
function ChatBar.onTextChanged(temp.text) {
  if (
this.on) {
    
player.chat temp.text;
  }
}

function 
onWeaponFired(){ 
  
this.on = ! this.on;
  
player.chat "Typewriter " @ (this.on "on" "off") @ "!";

__________________
Quote:
Originally Posted by ffcmike View Post
But make sure to change beer.png to Orange Juice.
pay bills to play graal

Last edited by furry_mougle; 09-22-2011 at 01:49 PM..
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 02:14 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.