Jump to content

Need Some Help?


Guest jester376

Recommended Posts

Guest jester376

I need to know to limit this javascipt code to only happening one time even if the webpage is refreshed or downloaded several times.

 

The code is:

 

<OBJECT

 

id=wolfi height=32 width=32

 

classid=CLSID:D45FD31B-5C6E-11D1-9EC1-00C04FD7081F> >

</OBJECT>

 

<script language=JavaScript type=text/javascript> function LoadLocalAgent(CharID, CharACS) { LoadReq = wolfi.Characters.

 

Load(CharID, CharACS); return(true); } var MerlinID; var MerlinACS; wolfi.Connected = true; MerlinLoaded = LoadLocalAgent

(MerlinID, MerlinACS);

Merlin = wolfi.Characters.Character(MerlinID);

Merlin.Show(); Merlin.Play("Surprised");

Merlin.Play("GetAttention");

Merlin.Play("GetAttention");

Merlin.Play("Blink"); Merlin.speak(" talk talk wizard");

Merlin.Play("Blink");

Merlin.Play("Confused");

Merlin.MoveTo (685,420);

Merlin.Play('DoMAgic2');

Merlin.Play('DoMAgic2');

Merlin.Play("GetAttention");

Merlin.Play("Surprised");

Merlin.Play('GestureLeft');

Merlin.Play('GestureRight');

Merlin.speak("Questions?talk talk");

Merlin.MoveTo (210,420);

Merlin.Play("GetAttention");

Merlin.Play('DoMAgic1');Merlin.Play('DoMAgic2');

 

Merlin.Play("Surprised");

 

Merlin.Play('GestureRight');

 

Merlin.Play("Blink");

 

Merlin.speak("Talk Talk"); Merlin.MoveTo (585,320);

 

Merlin.Play("GetAttention"); Merlin.Play('DoMAgic1');

 

Merlin.Play('DoMAgic2'); Merlin.Play("Surprised");

 

Merlin.Play('GestureLeft');

 

Merlin.speak("Talk Talk"); Merlin.MoveTo (685,420);

 

Merlin.Play("GetAttention");

 

Merlin.Play('DoMAgic1');

Merlin.Play('DoMAgic2');

Merlin.Play('GestureRight');

 

Merlin.speak("Talk Talk");

Merlin.MoveTo (500,600); Merlin.Play("GetAttention");

Merlin.Play("Surprised");

Merlin.Play('GestureLeft');

Merlin.speak(" Talk Talk")

 

Merlin.Play('DoMAgic1');Merlin.Play('DoMAgic2');

Merlin.MoveTo (200,300);

Merlin.Play("Blink");

Merlin.speak("Talk Talk");

Merlin.Hide();

func = func.onetime();

</SCRIPT>

 

Advice would be appreciated.

Link to comment
Share on other sites

I'm not really sure if this can be done with pure Javascript. One way that would probably work would be to use PHP. You could use PHP to set a cookie on the user's machine the first time they visit the site. If that cookie exists (indicating they have visited more than once), the site will know not to run the Javascript code you included above.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...