Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Code Gallery (https://forums.graalonline.com/forums/forumdisplay.php?f=179)
-   -   Clicky Thing (https://forums.graalonline.com/forums/showthread.php?t=134270363)

Gunderak 08-25-2016 05:05 AM

Clicky Thing
 
1 Attachment(s)
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});
  }


https://i.gyazo.com/fbff54bc47405c23...3d490e01bf.gif
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.

LebJoe 01-17-2017 05:26 PM

Woah, very nice and very creative :)

Elk 01-17-2017 06:49 PM

this reminds me of zodiac where you could enable your browser shown to others haha, it was realtime though

Crono 01-20-2017 05:15 PM

nice, zod has this in 2006 but still nice


All times are GMT +2. The time now is 12:13 PM.

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