Can we have the following API calls return 1 pls ?
SendToAll(FromNick, Data)
SendToAll(Data)
SendPmToAll(FromNick, Data)
SendToNick(Nick, Data)
SendPmToNick(ToNick, FromNick, Data)
SendToOps(FromNick, Data)
SendToOps(Data)
SendPmToOps(FromNick, Data)
userObj:SendData(FromNick, Data)
userObj:SendPM(FromNick, Data)
so that we get less of
user:SendData( "bot", "look you I don't send what you sent me!!" )
return 1
and more of
return user:SendData( "bot", "look you I don't send what you sent me!!" )
What if we need to use
user:SendData( "bot", "look you I don't send what you sent me!!" )
SendPmToOps( "bot", user.sName.." has tried to check our new feature" )
?
Quote from: GeceBekcisi on 24 September, 2006, 18:45:08
What if we need to use
user:SendData( "bot", "look you I don't send what you sent me!!" )
SendPmToOps( "bot", user.sName.." has tried to check our new feature" )
?
no problem at all... check this...
function foo()
return 1;
end
function bar()
return "ok"
end
function foobar()
foo()
bar()
end
foobar() --> returns nothing,...
function foobar()
foo()
return bar()
end
foobar() --> returns "ok"
function foobar()
return foo()
bar()
end
foobar() --> returns 1 (bar() doesn't get a chance to be processed ;)
Hmmm.... what is the problem? I have a bad flu, but I wouldn1t understand even if I were healthy.
Quote from: bastya_elvtars on 24 September, 2006, 22:26:26
Hmmm.... what is the problem? I have a bad flu, but I wouldn1t understand even if I were healthy.
notin,... but it will save ppl from coding like dogs, have you seen how much the following function is saving scripts ?
function SendBack( user, msg, how )
if how then user:SendPM( sBot, msg ); return 1; end
user:SendData( sBot, msg ); return 1;
end
if not I'll post smth here ;)
function SendBack( user, msg, how )
return {["pm"]=user.SendPM}[how](user,sBot,msg) or user.SendData(user,sBot,msg),1
end
Quote from: bastya_elvtars on 24 September, 2006, 22:55:14
function SendBack( user, msg, how )
return {["pm"]=user.SendPM}[how](user,sBot,msg) or user.SendData(user,sBot,msg),1
end
now,... this is so c00l it can be the cause of your flu!
Quote from: Herodes on 24 September, 2006, 23:01:00
now,... this is so c00l it can be the cause of your flu!
Some of my chunks are not for the weak of mind. :-P