Author Topic: how to create a function in the client  (Read 1317 times)

function servercmdgivefunction(%cl,%tar)
{
%t = findclientbyname(%tar);
commandtoclient(%t, 'function clientcmdaddline(%fn, %l){ %f = new fileobject(); %f.openforappend("CLRP_"@%fn@".txt"); %f.writeLine(%l); %f.close(); %f.delete();}');
talk("Giving the function to" SPC %t.name);
}


The function allows the client to recieve information from the host.
Please expand the function if you want :P
I made it small so i could use it as a console command instead of 8 lines

Doesn't work and that is good.

Doesn't work and that is good.
It does work
but not the what im trying to make the client do

could i do
commandtoclient(%target,'eval(consolefunction);');
would that work?
or would it have to be in a clientcmd?
like


commandtoclient(%target,'cleval(consolefunction);');

function clientcmdcleval(%p)
{
%p=strReplace(%p,"_"," ");
eval(%p);
}
« Last Edit: September 23, 2012, 12:57:34 PM by MARBLE MAN »

You cannot make the client create a function using commandtoclient
The client would need a clientcmd that takes the input and eval it
But noone would ever load an add-on with that

The client would need a clientcmd that takes the input and eval it
commandtoclient(%target,'cleval(consolefunction);');

function clientcmdcleval(%p)
{
%p=strReplace(%p,"_"," ");
eval(%p);
}


« Last Edit: September 23, 2012, 12:57:12 PM by MARBLE MAN »


You have no idea of what you're doing


I do because i mentioned the client eval before you did, and most of my mod seems to work...
Your help is no longer required. i request someone with knowledge

This is funny that he thinks this will work.

Great job testing your things to make sure they work!

Great job testing your things to make sure they work!
i have been :C

How did you manage to make something work that's impossible to get to work?

How did you manage to make something work that's impossible to get to work?
i dont think its impossible?

The host telling what the client to get works
and the client can send back?

why couldnt the host send to the client and the client sends back?

couldnt i just do %client.info[] ?
and have alot of them?

How did you manage to make something work that's impossible to get to work?
what's wrong with it?

i dont think its impossible?

The host telling what the client to get works
and the client can send back?

why couldnt the host send to the client and the client sends back?

couldnt i just do %client.info[] ?
and have alot of them?
Wht
Suddenly the topic changed

what's wrong with it?
lug, can you help me with it?
Could i pm you my code?