Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-25-2016, 05:05 AM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
Clicky Thing

This is a quick one I wrote on Zone iPhone, it's just used to show other staff where your mouse is, e.g. if you wish to point to a specific tile or NPC etc etc.

PHP Code:
//#CLIENTSIDE
//Seconds for clicks to be visible
const clicktime 3;
function 
onCreated(){
  
this.count 1;
  
this.on false;
  
onTimeout();
}
function 
onTimeout(){
  
//If Left Ctrl and Left Alt is down
  
if(keydown2(162true) && keydown2(164true)){
    
//This bool is used for when you click
    
this.on true;
    
with(findimg(22)){
      
image "gunderak_cursor.png";
      
mousex;
      
mousey;
      
alpha 0.5;
    }
  }else{
    if(
this.on){
      
this.on false;
      
hideimg(22);
    }
  }
  
//Loop through array of clicks
  
for(temp.click this.clicks){
    
temp.click[3] -= 0.05;
    
with(findimg(temp.click[0])){
      
image "g4_particle_x.png";
      
temp.click[1] -2;
      
temp.click[2] -2;
      
zoom 0.3;
      
alpha temp.click[3];
    }
    
//If the click is too old, remove
    
if(temp.click[3] <= 0){
      
hideimg(temp.click[0]);
      
this.clicks.remove(temp.click);
    }
  }
  
settimer(0.05);
}
function 
GraalControl.onMouseDown(){
  if(
this.on){
    
//This is used as an index for the click images
    
this.count ++;
    if(
this.count 200){
      
this.count 0;
    }
    
temp.ct clicktime;
    if(
int(player.chat) > 0temp.ct player.chat;
    if(
temp.ct 10temp.ct 20;
    
//Store click info in array
    
this.clicks.add({this.count,mousexmouseytemp.ct});
  }


The second ghosted mouse is the in game image.

Notes:
You may need to add the cursor image to the showimgsallowedimages option in server ops.

Usage:
Hold down Left Ctrl and Left Alt, other players and staff will be able to see your mouse and clicks while these keys are held down.
You can also set your player chat to a number < 20 to change the time clicks are visible.
Attached Images
 
__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion
Reply With Quote
  #2  
Old 01-17-2017, 05:26 PM
LebJoe LebJoe is offline
Dragon
Join Date: Aug 2016
Location: Lebanon
Posts: 16
LebJoe is on a distinguished road
Woah, very nice and very creative
Reply With Quote
  #3  
Old 01-17-2017, 06:49 PM
Elk Elk is offline
Sr Marketing Strategist
Elk's Avatar
Join Date: Nov 2005
Location: Deerland
Posts: 3,829
Elk has a brilliant futureElk has a brilliant futureElk has a brilliant futureElk has a brilliant futureElk has a brilliant futureElk has a brilliant futureElk has a brilliant future
Send a message via ICQ to Elk Send a message via AIM to Elk Send a message via MSN to Elk Send a message via Yahoo to Elk
this reminds me of zodiac where you could enable your browser shown to others haha, it was realtime though
__________________
iEra IGN: *Elk (Darkshire)
iCla. IGN: *Elk (Darkshire)
iZone IGN: *Elk (Darkshire)




Reply With Quote
  #4  
Old 01-20-2017, 05:15 PM
Crono Crono is offline
:pluffy:
Join Date: Feb 2002
Location: Sweden
Posts: 20,000
Crono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond repute
nice, zod has this in 2006 but still nice
__________________
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 11:58 PM.


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