View Single Post
  #1  
Old 04-19-2009, 09:53 AM
Nature2 Nature2 is offline
Registered User
Nature2's Avatar
Join Date: May 2005
Location: Germany
Posts: 171
Nature2 will become famous soon enough
Send a message via ICQ to Nature2 Send a message via AIM to Nature2 Send a message via MSN to Nature2 Send a message via Yahoo to Nature2
Simple Online-Notepad

Thats a very simple online-notepad with a simple save function that saves the strings to your account as client.blah = blah.
copy it into a weapon and press "-"

im sure it could be better but lets keep it simple ;P


PHP Code:
//#CLIENTSIDE

function onKeyPressed(keycharcharacter)

  if (
character == "-"){
  
notepad();
 } 
function 
notepad() {
//Main Window
  
new GuiWindowCtrl("Main_Window") {
    
profile GuiWindowProfile;
    
clientrelative true;
    
clientextent "320,310";

    
canclose false;
    
canmove true;
    
canminimize false;
    
canmaximize false;
    
canresize false;
    
closequery false;
    
destroyonhide false;
    
text "Online Notepad -" SPC player.account;
    
450;
    
180;
//CLose Button
    
new GuiButtonCtrl("Close_Button") {
      
profile GuiButtonProfile;
      
text "Close";
      
width 80;
      
height 20;
      
240;
      
291;
    }
    
//Select Window(Combo)
   
new GuiPopUpMenuCtrl("Select_Combo") {
      
profile GuiPopUpMenuProfile;
      
textprofile GuiTextListProfile;
      
scrollprofile GuiScrollProfile;
      
110;
      
291;
      
width 100;
      
height 20;
    
//Available Select
  
clearrows();
    
addrow(0,"Personal Notes"); //client.note
    
addrow(1,"My Kingdom"); //client.note_kingdom
    
addrow(2,"Buddys");//client.note_buddys
    
addrow(3,"Events");//client.note_events
    
addrow(4,"Trading");//client.note_trading
  
setSelectedRow(0);
}  
//Save Button
    
new GuiButtonCtrl("Save_Button") {
      
profile GuiButtonProfile;
      
text "Save";
      
width 80;
      
height 20;
      
291;
    }
    
//Text Field
    
new GuiScrollCtrl("Scroll_Field") {
      
profile GuiScrollProfile;
      
height 292;
      
hscrollbar "dynamic";
      
vscrollbar "dynamic";
      
width 320;
//Notepad text display
      
new GuiMLTextEditCtrl("Notepad_Text") {
        echo(
"Test");
        
profile GuiMLTextEditProfile;
        
height 16;
        
horizsizing "width";
        
text "NO NOTES LOADED";
        
width 295;
      }
    }
  }
}

function 
Close_Button.onAction() {
if(
client.note_dontask == 1){

Main_Window.destroy();
} else {
//Warning Window
  
new GuiWindowCtrl("Warning_Window1") {
    
profile GuiWindowProfile;
    
clientrelative true;
    
clientextent "253,106";

    
canclose false;
    
canmove true;
    
canresize true;
    
closequery false;
    
destroyonhide false;
    
text "Warning!";
    
524;
    
235;
//Yes window
    
new GuiButtonCtrl("Warning_Button1") {
      
profile GuiButtonProfile;
      
text "Yes";
      
width 80;
      
19;
      
51;
    }
    
//No window
    
new GuiButtonCtrl("Warning_Button2") {
      
profile GuiButtonProfile;
      
text "No";
      
width 80;
      
154;
      
50;
    }
    
//warning text1
    
new GuiTextCtrl("Warning_Text1") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "Really Want to close?";
      
width 104;
      
79;
    }
    
//warning text2
    
new GuiTextCtrl("Warning_Text2") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "If you haven't saved, all changes will be lost!";
      
width 213;
      
21;
      
24;
    }
  }
}
//If yes pressed
function Warning_Button1.onAction() {
 
Warning_Window1.destroy();
 
Main_Window.destroy();
}
//if no pressed
function Warning_Button2.onAction() {
 
Warning_Window1.destroy();
 }
}
//if save pressed
function Save_Button.onAction() {

 if(
Select_Combo.getselectedid() == 0){

client.note Notepad_Text.gettext();
  
player.chat "Your personal notes are saved!";
 }
  if(
Select_Combo.getselectedid() == 1){

client.note_kingdom Notepad_Text.gettext();
  
player.chat "Your kingdom notes are saved!";
 }
   if(
Select_Combo.getselectedid() == 2){

client.note_buddys Notepad_Text.gettext();
  
player.chat "Your buddy notes are saved!";
 }
   if(
Select_Combo.getselectedid() == 3){

client.note_events Notepad_Text.gettext();
  
player.chat "Your event notes are saved!";
 }
   if(
Select_Combo.getselectedid() == 4){

client.note_trading Notepad_Text.gettext();
  
player.chat "Your trading notes are saved!";
 }
}
//if a section is selected
function Select_Combo.onSelect(entryid,entrytext,entryindex){

if(
entryid == 0){
Notepad_Text.text client.note;
 }
 if(
entryid == 1){
Notepad_Text.text client.note_kingdom;
 }
  if(
entryid == 2){
Notepad_Text.text client.note_buddys;
 }
  if(
entryid == 3){
Notepad_Text.text client.note_events;
 }
  if(
entryid == 4){
Notepad_Text.text client.note_trading;
 }

Attached Thumbnails
Click image for larger version

Name:	online-notepad.png
Views:	219
Size:	54.0 KB
ID:	48170  
__________________

Last edited by Tigairius; 04-19-2009 at 10:16 AM.. Reason: Removed GK-Specific functions
Reply With Quote