Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 05-26-2009, 04:52 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Script events

You might find the following list of clientside script events useful:
HTML Code:
Global:
  onClassLoaded(str) - a class script has been updated: name of the class
  onConnectingToServer(str, str, int) - connecting to: servername, address, port
  onDefaultStyleChanges(str) - the $pref::Video::defaultguistyle has been changed
  onFileChunkReceived(str, int, int) - file download progress: filename, current position, full size
  onFileDownloaded(str, int) - a game file has been downloded: filename, size
  onFilesUploaded() - finished uploading all files to the file browser
  onFirstResponderChanges(obj) - the control that received the keyboard input changed
  onFolderLog(str) - scripted RC file browser message
  onLevelFileUpdated(str) - a game file has been updated: filename
  onLogMessage(str, float, float, float, str) - log message: text, red, green, blue, log type
  onMapClick(obj) - clicked on a player on the map: player object
  onMouseYawPitch(int, int) - the mouse moved in 3D mode: yaw and pitch
  onMusicDataReceived(str, str) - music meta data received: name and value
  onOfflineModeStarted() - the offline mode is started because there is no connection to the server
  onOpenHelpWindow() - the key for opening the help window (F1) has been pressed
  onOpenLogWindow() - the key for opening the log window (F2) has been pressed
  onOpenOptionsWindow() - the key for opening the options window (F3) has been pressed
  onOpenPlayerList() - the key for opening the player list (F7) has been pressed
  onOpenPlayerPositionWindow() - the key for opening the positon window (F5) has been pressed
  onOpenProfileWindow(obj) - right click on a player or call to showProfile() to open the profile window
  onOpenServerList() - the key for opening the serverlist (F8) has been pressed
  onPackagesDownloadComplete() - all update packages (.gupd files) have been downloaded
  onPackagesDownloaded() - some update packages (.gupd files) have been downloaded
  onPlayerChanges(obj, int) - the look of a player changed: player object and id
  onPlayerLanguageChanges(obj, str) - the language of the player has changed: player object, new language
  onPlayerLogin(obj, int) - a player logged in: player object and id
  onPlayerLogout(obj, int) - a player logged out: player object (might be NULL) and id
  onPM(obj) - received a PM from a player: player object
  onRCChat(str) - scripted RC chat: text
  onRemotePlayerChats(obj, str) - another player is saying something: player object, text
  onServerListerConnect() - a connection to the server-lister (central server) established
  onServerLogin() - logged into a server
  onToall(obj, str) - received a toall message: player object and message
  onTranslationUpdated(str) - a translation file (.po) has been updated
  onUpdatePackageDownloaded(obj) - downloaded an update package (.gupd): package object

  GuiControl (TGraalVar):
    onAction() - an action happened (e.g. button pressed)
    onAdd() - the control has been added as child to another control
    onDialogPop() - the control is no longer the dialog control (popDialog())
    onDialogPush() - the control is now the dialog control (pushDialog())
    onDropFiles(int, int, obj) - files dropped from explorer/finder to the control (acceptdropfiles must be true): x, y, filelist
    onHide() - the control is no longer visible on the screen
    onKeyDown(int, str, int) - a key has been pressed: keycode, keytext, scancode
    onKeyUp(int, str, int) - a key has been released: keycode, keytext, scancode
    onMouseDown(int, int, int, int) - mouse click: key modifiers, mouse x and y, click count
    onMouseDragged(int, int, int, int) - mouse moved while holding the mouse button down: key modifiers, mouse x and y, click count
    onMouseEnter(int, int, int, int) - mouse enters the area of the control: key modifiers, mouse x and y, click count
    onMouseLeave(int, int, int, int) - mouse leaves the are of the control: key modifiers, mouse x and y, click count
    onMouseMove(int, int, int, int) - mouse moved: key modifiers, mouse x and y, click count
    onMouseUp(int, int, int, int) - mouse button released: key modifiers, mouse x and y, click count
    onMouseWheelDown(int, int, int, int) - mouse wheel scrolled down: key modifiers, mouse x and y, click count
    onMouseWheelUp(int, int, int, int) - mouse wheel scrolled up: key modifiers, mouse x and y, click count
    onMove(int, int) - the control has been moved to x, y
    onRemove() - the control has been removed from its parent
    onResize(int, int) - the control has been resized to width, height
    onRightMouseDown(int, int, int, int) - right mouse click: key modifiers, mouse x and y, click count
    onRightMouseDragged(int, int, int, int) - mouse moved while holding the right mouse button down: key modifiers, mouse x and y, click count
    onRightMouseUp(int, int, int, int) - right mouse button released: key modifiers, mouse x and y, click count
    onShow() - the control becomes actually visible on the screen
    onSleep() - the control is not part of the screen anymore
    onStartDrag() - the user is moving the control
    onStopDrag(int, int, int, int) - stopped moving a control: key modifiers, mouse x and y, click count
    onStyleChanges() - the GUI style has changed 
    onWake() - the control has been added to the screen

    GuiAnimationCtrl (GuiControl):
      onAnimationEnd(int) - finished moving: new entry index
      onAnimationStart(int, int) - started moving: current entry index, destination entry index

    GuiArrayCtrl (GuiControl):
      onOpenMenu(int, int, int, int) - right click on an entry: column, row, mouse x and y
      onSelect(int, int) - an entry has been selected: column and row

      GuiTextListCtrl (GuiArrayCtrl):
        onDblClick(int, str, int) - double click on a list entry: id, text, row
        onDeleteKey(int, str, int) - delete key pressed for an entry: id, text, row
        onIconResized(int, int) - the size of the icons has been changed: new width and height
        onMouseOverCell(int, str, int) - the mouse is hovering over a list entry: id, text, row
        onOpenMenu(int, str, int) - right-click on a list entry: id, text, row
        onSelect(int, str, int) - a list entry has been selected: id, text, row

      GuiTreeViewCtrl (GuiArrayCtrl):
        onDblClick(obj, str, str) - double-click on a node: node object, slash-path, dot-path
        onExpand(obj, str, str) - a node is expanding: node object, slash-path, dot-path
        onFold(obj, str, str) - a node is folded: node object: slash-path, dot-path
        onIconResized(int, int) - the size of the icons has been changed: new width and height
        onMouseOverCell(obj, str, str) - the mouse is hovering over a node: node object, slash-path, dot-path
        onOpenMenu(obj, str, str) - right click on a node: node object, slash-path, dot-path
        onSelect(obj, str, str) - a node is selected: node object, slash-path, dot-path

    GuiContextMenuCtrl (GuiControl):
      onCancel() - the menu has been closed without selecting an entry
      onSelect(int, str, int) - a menu entry has been selected: id, text and row

      GuiStartMenuCtrl (GuiContextMenuCtrl):
        onCancel() - the menu has been closed without selecting an entry
        onSelect(int, str, int) - a menu entry has been selected: id, text and row
        onTextChanged(str) - the menu text has been changed

    GuiMenuCtrl (GuiControl):
      onCancel() - the menu has been closed without selecting a menu entry
      onIconResized(int, int) - the size of the icons has been changed: new width and height
      onSelect(str, int, str, int) - a menu item has been selected: menu name, selection id, text and row

    GuiMLTextCtrl (GuiControl):
      onCursorLineChanged(int) - cursor moved: new line number
      onReflow(int, int) - the displayed content changed: new visible width and height
      onRightSelectTag(str) - right click on: tag id
      onSelectTag(str) - the user clicked on a tag or bitmap: tag id
      onURL(str) - the user clicked on an url

    GuiSliderCtrl (GuiControl):
      onAction(float) - the slider value has been changed (by script or user): new slider value
      onReleaseSlider(float) - the user has finishzed moving the slider: new slider value

    GuiSpriteCtrl (GuiControl):
      onPlayerDies() - the player died
      onUpdateScore(int, int) - new score: new total score, added points

    GuiTabCtrl (GuiControl):
      onDeselect(int, str, int) - a tab is no longer selected: id, text, row
      onIconResized(int, int) - the size of the icons has been changed: new width and height
      onMouseOverCell(int, str, int) - the mouse is hovering over a tab: id, text, row
      onOpenMenu(int, int, int) - the user has clicked with the right mouse button on an entry: row, mouse x and y
      onSelect(int, str, int) - a tab has been selected: id, text, row

    GuiTextCtrl (GuiControl):
      onTextChanged(str) - text has been changed

      GuiPopUpEditCtrl (GuiTextCtrl):
        onCancel() - the menu has been closed without selecting an entry
        onSelect(int, str, int) - a menu entry has been selected: id, text and row

      GuiPopUpMenuCtrl (GuiTextCtrl):
        onCancel() - the menu has been closed without selecting an entry
        onSelect(int, str, int) - a menu entry has been selected: id, text and row

      GuiTextEditCtrl (GuiTextCtrl):
        onAction(str) - a text has been entered (return key pressed)
        onTabComplete(bool) - the tab key has been pressed (with or without shift key)

      GuiWindowCtrl (GuiTextCtrl):
        onCloseQuery() - the player clicked on the close button and closequery=true
        onTextChanged(str) - the window title has been changed
I don't know whether all of the global events will be available to unprivileged (non-login) scripts like onConnectingToServer() but I guess they are not a lot of use to unprivileged scripts anyway.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 07:20 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.