Thread: Typewriter
View Single Post
  #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