Repeat after me

Need help with your JScripts? Got questions concerning the DFNs? Come forward, step inside :)
Post Reply
Mindless Automaton
UOX3 Apprentice
Posts: 189
Joined: Wed May 10, 2006 3:48 am
Has thanked: 0
Been thanked: 1 time
Contact:

Repeat after me

Post by Mindless Automaton »

ok, based on your example, I did this:

Code: Select all

	IsTalking = false;
	i =0;

function onAISliver( tChar )
{
	var hour 	= GetHour();
	var minute	= GetMinute();

	var hDisp = hour.toString();
	var mDisp = minute.toString();
	if( minute < 10 )
		mDisp = "0" + mDisp;

	var curr_time = hDisp + ":" + mDisp; //set up the clock


	if ( curr_time == "14:00" && IsTalking == false)
	{
		IsTalking == true;
		i = i + 1;
		tChar.TextMessage( curr_time + " " + i );
	

	}

}
except there is an if statement for each hour. However, when the hour fires off, it repeats like 40 times.
Also tried this:

Code: Select all

	if ( curr_time == "22:00" && IsTalking == false)
	{
	{
	for (i = 0; i < 1;i++) {
		IsTalking == true;
		tChar.TextMessage( curr_time + " " + i );
	}
	}
Same results (although i was always 0)
Mindless Automaton
Linux - UOX3 - 0.99.5 dev branch
Win10Pro 19042.572 - UOX3 0.99.3a; Razor 1.0.14; Client 7.0.87.11 or 4.0.11c (Patch 0)
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

Here lies your problem:

Code: Select all

IsTalking == true;
Double assignment == no assignment at all :)
-= Ho Eyo He Hum =-
Mindless Automaton
UOX3 Apprentice
Posts: 189
Joined: Wed May 10, 2006 3:48 am
Has thanked: 0
Been thanked: 1 time
Contact:

Post by Mindless Automaton »

Xuri wrote: Sat Nov 14, 2020 7:14 am Here lies your problem:

Code: Select all

IsTalking == true;
Double assignment == no assignment at all :)
Curse my Visual Basic background! I knew it was going to be some fix like that.. Thansk!
Mindless Automaton
Linux - UOX3 - 0.99.5 dev branch
Win10Pro 19042.572 - UOX3 0.99.3a; Razor 1.0.14; Client 7.0.87.11 or 4.0.11c (Patch 0)
Post Reply