View Single Post
  #1  
Old 07-18-2006, 08:27 AM
calani calani is offline
Scriptess
calani's Avatar
Join Date: Aug 2003
Location: asmgarden.gmap
Posts: 606
calani is on a distinguished road
Send a message via AIM to calani
Question dynamic function calling

Okay, I'm trying to do something, and I'm not sure if its supported by GS2 or not.

I'm trying to redo my system in such a way that I can call any function from chat or suchlike without having one gigantic switch and hardcoding each functioncall.

Basically, I'm trying to do this:

PHP Code:
function callfunc(temp.funcname,temp.fparams) {
  
temp.fparams=replacemarkers(temp.fparams);  // replace escapes with values
  
(@temp.funcname)(temp.fparams);  // call the function
}

function 
prop(temp.fparams) {
  
do_stuff();

This way I could call a showimg, setfocus, local functions, etc.
I'm going to add in a preset sys that lets me do preset action (or set new ones) to keys. as an example, lmouse="gani $ sit 0" would call a local gani() function with the params "$m jellybean blue.png". (I use $m as an escape that refers to the current mousetarget. others are $mx $my for mouse xy, etc)


Problem I'm having - this just doesn't work.
__________________
Reply With Quote