First, your use of lasttime and firsttime look ok to me.
I see several possibilities:
You are using 'lowchat' without defining what it is. Make sure it is
defined as: CHATSTR LOWERCASE lowchat =
Also, you do not have 'namesaid' defined. It will will always cause the
script to fail if not defined.
Lastly, the OUTCHAT part of this script isn't doing anything and can be
deleted.
--
Alan Templeton
Sunnyvale, CA
Home page: http://www.accesscom.com/~alant
Palace scripts: http://www.chatserve.com/alansscriptlibrary.htm
> From: "palwizard" <palwizard@...>
> Reply-To: palace-bots@yahoogroups.com
> Date: Tue, 11 Dec 2001 05:01:20 -0000
> To: palace-bots@yahoogroups.com
> Subject: [palace-bots] Re: flood stopper for "hello" routine
>
> im having a prob with this timer, it appears to have disabled the
> routine it runs with. here is how i installed it.
>
> ON OUTCHAT {
> lastTime GLOBAL
> thisTime GLOBAL
> }
> ON INCHAT {
> lastTime GLOBAL
> thisTime GLOBAL
>
> { { "Hello, " WHOCHAT WHONAME & "!" & SAY
> { DATETIME 2212136900 + thisTime = } { DATETIME thisTime = } DATETIME
> 0 < IFELSE
> lastTime thisTime = } lastTime 2 + thisTime < IF } lowchat "hello"
> SUBSTR
> lowchat "hi " GREPSTR OR
> namesaid AND WHOCHAT WHOME != AND IF
> }
>
> have i installed this script incorrectly? i makes the bot reply once
> to the first hello or hi directed at it, and then it will not reply
> to any other hello or hi's from any user. Any ideas?
>
> Thanks!
>
>
> --- In palace-bots@y..., "Mike Sparling" <msparling@m...> wrote:
>> D'oh...... I see some problems with my script (I hate when that
> happens!)
>>
>> How about this? Delcare the thisTime variable ON SIGNON, just like
> you did,
>> then put in the script below.
>> The lastTime and the thisTime variables are merely holders to see
> when the
>> command was last exectuted.
>> And, yes, the command would be executed ON INCHAT for a bot, so you
> had that
>> part right on!
>>
>> The error I saw was the 120 -- DATETIME is in seconds, not 1/60 of
> a second,
>> so that should be changed to a 2 rather than a 120.
>>
>> The other problem is in the IF check... we are going to need to put
> the new
>> check inside the other check, so it should look like this:
>>
>> lastTime GLOBAL
>> thisTime GLOBAL
>>
>> { { "Hello, " WHOCHAT WHONAME & "!" & SAY
>> { DATETIME 2212136900 + thisTime = } { DATETIME thisTime = }
> DATETIME
>> 0 < IFELSE
>> lastTime thisTime = } lastTime 2 + thisTime < IF } lowchat "hello"
> SUBSTR
>> lowchat "hi " GREPSTR OR
>> namesaid AND WHOCHAT WHOME != AND IF
>> }
>>
>>>
>>> ON SIGNON {
>>> lastTime GLOBAL
>>> thisTime GLOBAL
>>> { DATETIME 2212136900 + thisTime = } { DATETIME thisTime = }
> DATETIME
>>> 0 < IFELSE
>>> }
>>>
>
>
>
> To unsubscribe from this group, send an email to:
> palace-bots-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>