Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > Code Gallery
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-01-2007, 01:21 AM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
Support Center System [Unfinished]

Here's another unfinished script of mine (that I don't plan on finishing). Features right now include submitting tickets, and admins can view, delete, open, or close tickets. Never got around to scripting responses.

Modify NPC (Control-NPC):
PHP Code:
function onRCChat()
{
  if (
params[0] == "viewcomplaint"
    
findNPC("Complaint-Database").ViewComplaint(params[1]);

Create NPC (Complaint-Database):
PHP Code:
/*

NPC by Rapidwolve

*/

function onCreated()
  
createVariables();
  
function 
createVariables()
{
  
this.skip_flags = {"alerts_highlevel""skip_flags""registered_complaints",  "allowed_admincenter""debug_mode"};
  
this.alerts_highlevel = {"High""Serious"};
  
this.debug_mode false;  // Output all actions to NC
  
this.allowed_admincenter = {"rapidwolve""Frotter"};  // People allowed to the admin center
}

public function 
RegisterComplaint(complainercategoryseriousnessdescription)
{
  
temp.id NextAvailableID();
  
this.("complaint_" temp.id) = {temp.complainertemp.categorytemp.seriousnesstemp.description"Open"};
  
  
findPlayer(temp.complainer).triggerClient("weapon""-Complaint Reporter""SentComplaint"temp.id);
  
  if(
temp.seriousness in this.alerts_highlevel)
  
sendMessage(format("New high priority ticket submitted by, %s. Index: %i"temp.complainertemp.id), true);
  
  
this.registered_complaints ++;
}

public function 
NextAvailableID()
{
  
temp.currentid 1;
  
    while (
this.("complaint_" temp.currentid)[0])
      
temp.currentid ++;
      
  return (
temp.currentid);
}

public function 
sendMessage(messageoverride)
{
  if (
this.debug_mode || temp.override)
    echo(
format("[Support Center]: %s"temp.message));
}

public function 
ViewComplaint(id)
{
  
temp.complaint this.("complaint_" temp.id);
  if (!
temp.complaint[0]) return sendMessage("No such complaint index. " temp.id);
  
  
sendpm("--Viewing complaint (Index-" SPC temp.id ")--:" NL
  
"Complainer: " temp.complaint[0NL
  
"Category: " temp.complaint[1NL
  
"Priority: " temp.complaint[2NL
  
"Description: " temp.complaint[3]);
}


public function 
GetSupportTickets(admin)
{
  if (!(
temp.admin in this.allowed_admincenter) && !(temp.admin == this.allowed_admincenter)) 
    return 
findPlayer(temp.admin).triggerClient("weapon""-Complaint Reporter""NotAllowed");
  
  
temp.list.clear();
  
  for (
temp.ithis.getDynamicVarNames())
  {
    if (
temp.i[0in this.skip_flags) continue;
      
temp.idlist.add(temp.i.substring(("complaint_").length()));
      
temp.list.add((this.(@temp.i)));
  }

  
findPlayer(temp.admin).triggerClient("weapon""-Complaint Reporter""RefreshTicketsList"temp.list, temp.idlist);
}

public function 
GetPlayerSupportTickets(account)
{
  
temp.list.clear();
  
  for (
temp.ithis.getDynamicVarNames())
  {
    if ((
temp.i[0in this.skip_flags) || (this.(@temp.i)[0] != temp.account)) continue;
      
temp.idlist.add(temp.i.substring(("complaint_").length()));
      
temp.list.add((this.(@temp.i)));
  }
  
findPlayer(temp.account).triggerClient("weapon""-Complaint Reporter""RefreshMyTicketsList"temp.list, temp.idlist);
}

public function 
GetSupportTicket(idadmin)
  
findPlayer(temp.admin).triggerClient("weapon""-Complaint Reporter""ViewSupportTicket"temp.idthis.("complaint_" temp.id));

public function 
CloseTicket(id){
  
sendMessage(format("%s has closed ticket %i"player.accounttemp.id));
  
this.("complaint_" temp.id)[4] = "Closed";
}

public function 
OpenTicket(id){
  
sendMessage(format("%s has opened ticket %i"player.accounttemp.id));
  
this.("complaint_" temp.id)[4] = "Open";
}

public function 
DeleteTicket(id){
  
sendMessage(format("%s has deleted ticket %i"player.accounttemp.id));
  
this.("complaint_" temp.id).clear();
  
this.("complaint_" temp.id) == "";  // double check
}

public function 
toggleTicketStatus(id){
  
temp.ticket this.("complaint_" temp.id)[4];
  ((
temp.ticket == "Open") ? CloseTicket(temp.id):OpenTicket(temp.id));

Images can be found at:
http://forums.graal2001.com/forums/s...ad.php?t=73510
Reply With Quote
  #2  
Old 05-01-2007, 01:24 AM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
Create Weapon (-Complaint Reporter):
Part 1
PHP Code:
/*

NPC by Rapidwolve
Last Updated: April 15, 2007

*/

function onCreated()
  
this.database findNPC("Complaint-Database");
  
function 
onActionServerside(action)
{
  switch (
action)
  {
    case 
"RegisterComplaint":
      
this.database.RegisterComplaint(params[1], params[2], params[3], params[4]); // [1 = Account | 2 = Category | 3 = Seriousness| 4 = Description]
    
break;
    
    case 
"GetSupportTickets":
      
this.database.GetSupportTickets(player.account);
    break;
    
    case 
"GetSupportTicket":
      
this.database.GetSupportTicket(params[1], player.account);
    break;
    
    case 
"GetMySupportTickets":
      
this.database.GetPlayerSupportTickets(player.account);
    break;
    
    case 
"CloseTicket":
      
this.database.CloseTicket(params[1]);
    break;
    
    case 
"toggleTicketStatus":
      
this.database.toggleTicketStatus(params[1]);
    break;
    
    case 
"DeleteTicket":
      
this.database.DeleteTicket(params[1]);
    break;
  }
}

//#CLIENTSIDE

function onCreated()
  
resetVariables();

function 
resetVariables()
{
  
enum key
  
{
    
F9 120,
    
F11 122
  
};

  
join("profiles");   // Allows use of ZodiacWindowProfile
  
  
this.verification_code "0verRide";  // Overrides the current verification code
  
  
this.description_minimum 30;  // Minimum characters for the description
  
this.description_maximum 500// Maximum characters for the description
  
  
this.complaint_categorys 
  {
"Script Error""Hacker","Faulty Weapon/Skill"
  
"Heavy Lag""Monster Malfunction""Event Error"// Categorys
  
"Corruption""Wrongful Jailing""Suggestions",
  
"Other"
  
};
  
  
this.admin_message =
  
"<center>
  Welcome to the Administration Desk for Support Center
  to use, right or double click on a ticket and select an option.
  <b>View Ticket</b> opens the ticket and allows you to view the
  description and add a reply or close the ticket. <b>Toggle Status</b> 
  toggles depending on whether the ticket is Open or Closed.
  
  This system was created by <i>Rapidwolve</i></center>"
;
  
  
this.priority_levels 
  {
"Serious""High""Medium"
  
"Low""Unimportant"};  // Priority Levels
  
  
this.terms =
  
"<center>
  Welcome to Zodiac's Support Center, please note
  that abuse of this tool or providing false information
  can and will result in a jailing or possibly a ban
  depending on the offense. All actions are logged.
  </center>"
;   // Terms
  
  
this.active false;
  
  
this.admin_active false;
}
function 
onKeyPressed(codekey)
{
  switch (
temp.code)
  {
    case 
key.F9:   // [F9] Key
      
this.active = (this.active false true);   // If its active then make it not active, vice cersa
      
toggleWindow();
    break;
    
    case 
key.F11:   // [F11] Key
      
this.admin_active = (this.admin_active false true);
      
toggleAdminWindow();
    break;
  }
}

function 
toggleWindow()

  if (
this.active)
    
CloseSystem();    // Close if already open when [F9] is pressed
  
else 
    
drawWindow();     // Open if closed when [F9] is pressed

Reply With Quote
  #3  
Old 05-01-2007, 01:25 AM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
Append to Weapon (-Complaint Reporter):
Part 2
PHP Code:
function toggleAdminWindow()
{
  if (
this.admin_active)
    
CloseAdminSystem();
  else
    
drawAdminWindow();
}

function 
drawWindow()
{
  new 
GuiWindowCtrl("Reporter_Window")
  {
    
profile "ZodiacWindowProfile";
    
visible true;
    
title true;
    
position = {(screenwidth 3), (screenheight 3)};
    
text "Zodiac Support Center; Submit Ticket - Press [F9] to close";
    
canMaximize canMinimize canResize canClose false;
    
extent = {400360};
    
    new 
GuiScrollCtrl("Reporter_Holder")
    {
      
profile "GuiBlueScrollProfile";
      
hScrollBar vScrollBar "alwaysOff";
      
position = {624};
      
extent = {(400-12), (360-60)};
      
      new 
GuiMLTextCtrl("Reporter_Terms")
      {
        
width 260;
        
position = {60170};
        
profile "GuiBlueTextProfile";
        
text thiso.terms;
      }
      
      new 
GuiCheckBoxCtrl("Reporter_AcceptTerms")
      {
          
profile "GuiBlueCheckBoxProfile";
          
text "Accept";
          
extent = {5215};
          
position = {160260};
          
checked false;
          
thiso.catchevent(this"onAction""GenerateCode");
      }
      
      new 
GuiMLTextCtrl("Reporter_Code")
      {
          
profile "GuiBlueCheckBoxProfile";
          
text "Please accept the terms for the code";
          
extent = {19215};
          
position = {115280};
      }
      
      new 
GuiTextCtrl("Reporter_TypeLabel")
      {
        
profile "GuiBlueTextProfile";
        
position = {2440};
        
text "Category:";
      }
      
      new 
GuiTextCtrl("Reporter_PriorityLabel")
      {
        
profile "GuiBlueTextProfile";
        
position = {2410};
        
text "Priority:";
      }
      
      new 
GuiTextCtrl("Reporter_DescriptionLabel")
      {
        
profile "GuiBlueTextProfile";
        
position = {24110};
        
text "Description:";
      }
      
      new 
GuiScrollCtrl("Reporter_DescriptionHolder")
      {
        
profile "GuiBlueScrollProfile";
        
position = {220110};
        
extent = {15065};
        
hScrollBar "alwaysOff";
        
vScrollBar "dynamic";
        
        new 
GuiMLTextEditCtrl("Reporter_InputDescription")
        {
          
profile "GuiBlueTextProfile";
          
position = {10};
          
width 143;
        }
      }

      new 
GuiPopUpMenuCtrl("Reporter_ListSeriousness")
      {
        
profile "GuiBluePopUpMenuProfile";
        
textprofile "GuiBlueTextProfile";
        
scrollprofile "GuiBlueScrollProfile";
        
        
extent = {15025};
        
position = {22010};
        
clearrows();
        
        for (
temp.rowsthiso.priority_levels)
          
addRow(1temp.rows);
        
setSelectedRow(2);
      
      }
      
      new 
GuiScrollCtrl("Reporter_InputTypeHolder")
      {
        
profile "GuiBlueScrollProfile";
        
hScrollBar "alwaysOff";
        
vScrollBar "dynamic";
        
extent = {15065};
        
position = {22040};
        
        new 
GuiTextListCtrl("Reporter_InputTSelections")
        {
          
profile "GuiBlueTextListProfile";
          
width 140;
          
fitparentwidth true;
          
clearrows();
          for (
temp.rowsthiso.complaint_categorys)
            
addRow(0temp.rows);
          
setSelectedRow(0);
        }
      }
    }
    
      new 
GuiButtonCtrl("Reporter_BtnFAQ")
      {
        
profile "GuiBlueButtonProfile";
        
position = {6327};
        
extent = {6525};
        
text "Read FAQ";
        
thiso.catchevent(this"onAction""ViewFAQ");
      }
      new 
GuiButtonCtrl("Reporter_BtnAbout")
      {
        
profile "GuiBlueButtonProfile";
        
position = {70327};
        
extent = {6325};
        
text "About";
        
thiso.catchevent(this"onAction""ViewAboutText");
      }
      new 
GuiTextEditCtrl("Reporter_VerifyTextCode1")
      {
        
position = {134327};
        
profile "GuiBlueTextEditProfile";
        
extent = {9525};
        
text "<Insert Code>";
        
thiso.catchevent(this"onAction""SubmitComplaint");
      }

      new 
GuiButtonCtrl("Reporter_BtnViewMyTickets")
      {
        
profile "GuiBlueButtonProfile";
        
position = {230327};
        
extent = {9025};
        
text "View My Tickets";
        
thiso.catchevent(this"onAction""ViewMyTicketList");
    }
    
      new 
GuiButtonCtrl("Reporter_BtnSubmit")
      {
        
profile "GuiBlueButtonProfile";
        
position = {320327};
        
extent = {7525};
        
text "Submit Ticket";
        
thiso.catchevent(this"onAction""SubmitComplaint");
    }
  }
}

function 
drawAdminWindow()
{
  
GetSupportTickets();
  new 
GuiWindowCtrl("AdminCenter_Window")
  {
    
profile "ZodiacWindowProfile";
    
title true;
    
position = {(screenwidth 2), (screenheight 3)};
    
extent = {400345};
    
text "Zodiac Support Center; Administration Desk - Press [F11] to close";
    
canMaximize canMinimize canResize canClose false;
    
    new 
GuiScrollCtrl("AdminCenter_Holder")
    {
      
profile "GuiBlueScrollProfile";
      
hScrollBar vScrollBar "alwaysOff";
      
position = {624};
      
extent = {(400-12), 300};
      
      new 
GuiScrollCtrl("AdminCenter_ListHolder")
      {
        
profile "GuiBlueScrollProfile";
        
extent = {385150};
        
hScrollbar "alwaysOff";
        
vScrollbar "dynamic";
        
        new 
GuiTextListCtrl("AdminCenter_List")
        {
          
profile "GuiBlueTextListProfile";
          
columns "0 25 125 245 320";
          
sortmode "value";
          
sortorder "ascending";
          
groupsortorder "ascending";
          
sortvalue 1;
          
sort();
          
addRow(-1"Loading...");
          
thiso.catchevent(this"onOpenMenu""OpenMenu");
          
thiso.catchevent(this"onDblClick""OpenMenu");
        }
      }
      
      new 
GuiMLTextCtrl("AdminCenter_HelpText")
      {
        
profile "GuiBlueTextProfile";
        
position = {10150};
        
text thiso.admin_message;
        
width 360;
      }
    }
  }
}


function 
drawErrorWindow(_title_message)  // Popup Error Windows
{
  new 
GuiWindowCtrl("ReporterError_Window")
  {
    
profile "ZodiacWindowProfile";
    
extent = {400120};
    
position = {(screenwidth random(-20,50)), (screenheight random(-20,50))};
    
canMaximize canMinimize canResize canClose false;
    
title true;
    
text "Zodiac Support Center; Error - " temp._title;
    
visible true;
    
    new 
GuiScrollCtrl("ReporterError_Scroll")
    {
      
profile "GuiBlueScrollProfile";
      
extent = {38890};
      
hScrollBar vScrollBar "alwaysOff";
      
position = {624};
      
    new 
GuiMLTextCtrl("ReporterError_MessageText")
    {
      
position = {100};
      
width 370;
      
profile "GuiBlueTextProfile";
      
text "<center>" temp._message "</center>";
    }
    
    new 
GuiButtonCtrl("ReporterError_BtnOk")
    {
      
profile "GuiBlueButtonProfile";
      
text "Ok";
      
position = {13560};
      
extent = {10025};
      
thiso.catchevent(this"onAction""CloseErrorWindow");
      }
      
    }
  }
}

function 
ViewMyTicketList()
{
  
GetMySupportTickets();
  
  new 
GuiWindowCtrl("SupportCenter_MyTicketsWin")
  {
    
profile "ZodiacWindowProfile";
    
title true;
    
extent = {400335};
    
text "Zodiac Support Center; My Tickets";
    
visible true;
    
canMaximize canResize canMinimize false;
    
position = {(GraalControl.width this.width) /2, (GraalControl.height this.height)/2};
    
    new 
GuiScrollCtrl("SupportCenter_MyTicketsScrl")
    {
      
position = {624};
      
profile "GuiBlueScrollProfile";
      
extent = {(400-12), 280};
      
hScrollbar vScrollBar "alwaysOff";
      
      new 
GuiScrollCtrl("SupportCenter_TicketListHolder")
      {
        
profile "GuiBlueScrollProfile";
        
extent = {385150};
        
hScrollbar "alwaysOff";
        
vScrollbar "dynamic";
        
        new 
GuiTextListCtrl("SupportCenter_MyTicketList")
        {
          
profile "GuiBlueTextListProfile";
          
columns "0 25 125 245 320";
          
clearRows();
          
addRow(-1"Loading...");
          
thiso.catchevent(this"onOpenMenu""OpenMenu2");
          
thiso.catchevent(this"onDblClick""OpenMenu2");
        }
      }
    }
    
    new 
GuiButtonCtrl("SupportCenter_MyTicketsClose")
    {
      
profile "GuiBlueButtonProfile";
      
text "Close";
      
position = {160305};
      
extent = {7025};
      
thiso.catchevent(this"onAction""CloseMyTickets");
    }
  }
}

function 
CloseMyTickets()
  (
"SupportCenter_MyTicketsWin").destroy(); 
Reply With Quote
  #4  
Old 05-01-2007, 01:26 AM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
Append to weapon (-Complaint Reporter):
Part 3
PHP Code:
function OpenMenu(controlticketid)
{
  if (
temp.ticketid 0) return;
  
  new 
GuiContextMenuCtrl("AdminCenter_Menu-" temp.ticketid)
  {
      
textprofile "GuiBlueTextListProfile";
      
profile "GuiBluePopUpMenuProfile";
      
      
clearrows();
           
      
addRow(1"View Ticket");
      
addRow(-1"-");
      
addRow(2"Toggle Status");
      
      
this.open(mousescreenxmousescreeny);
      
thiso.catchevent(this"onSelect""MenuSelected");
  }
}

function 
OpenMenu2(controlticketid)
{
  if (
temp.ticketid 0) return;
  
  new 
GuiContextMenuCtrl("SupportCenter_Menu-" temp.ticketid)
  {
      
textprofile "GuiBlueTextListProfile";
      
profile "GuiBluePopUpMenuProfile";
      
      
clearrows();
           
      
addRow(1"View Ticket");
      
addRow(-1"-");
      
addRow(2"Delete Ticket");
      
      
this.open(mousescreenxmousescreeny);
      
thiso.catchevent(this"onSelect""MenuSelected2");
  }
}

function 
MenuSelected(controlmenuidmenutext)
{
  
temp.ticket_id temp.control.substring(("AdminCenter_Menu-").length());  
  
  switch (
temp.menutext)
  {
    case 
"View Ticket":
      
GetSupportTicket(temp.ticket_id);
    break;
    
    case 
"Toggle Status":
      
ToggleTicketStatus(temp.ticket_id);
    break;
  }
}

function 
MenuSelected2(controlmenuidmenutext)
{
  
temp.ticket_id temp.control.substring(("SupportCenter_Menu-").length());  
  
  switch (
temp.menutext)
  {
    case 
"View Ticket":
      
GetSupportTicket(temp.ticket_id);
    break;
    
    case 
"Delete Ticket":
      
DeleteTicket(temp.ticket_idtrue);
    break;

  }
}

function 
GenerateCode(control)
{
  if (!
temp.control.checked)
    return (
"Reporter_Code").setText("Please accept the terms for the code");
    
  
this.verification_code "0verRide";
  
temp.finalcode "";

  
temp.codeprefix = {"xhEa""tXay""h6aE""tx3A""y7kh""5acR"};
  
temp.codemedian = {"+""-""_"";""|""@""%"};
  
temp.codesuffix = {"hh5AE""f2glE""T5xeA""Tf3xE""x66h2"};
  
  
temp.finalcode temp.codeprefix[random(0temp.codeprefix.size())] @ temp.codemedian[random(0temp.codemedian.size())] @ temp.codesuffix[random(0temp.codesuffix.size())];
  
  (
"Reporter_Code").setText(format("Verification code: <b>%s</b>"temp.finalcode));
  
  
this.verification_code temp.finalcode;
}

function 
onActionClientside(action)
{
  switch (
action)
  {
    case 
"SentComplaint":
      
CloseSystem();
      
player.chat "[Support Center]: Your ticket was succesfully received. [Ticket ID:" SPC params[1] @ "]!";
    break;
    
    case 
"RefreshTicketsList":
      
RefreshTicketsList(params[1], params[2]);
    break;
    
    case 
"ViewSupportTicket":
      
ViewSupportTicket(params[1], params[2]);
    break;
    
    case 
"RefreshMyTicketsList":
      
RefreshMyTicketsList(params[1], params[2]);
    break;
    
    case 
"NotAllowed":
      
CloseAdminSystem();
      
player.chat "[Support Center]: You aren't on the allow list";
    break;
  }
}

function 
ViewSupportTicket(idfields)
{
  
this.id "";
  
this.fields.clear();
  
  
this.id temp.id;
  
this.fields temp.fields;

  new 
GuiWindowCtrl("SupportTicket_" temp.id)
  {
    
profile "ZodiacWindowProfile";
    
title true;
    
extent = {300,350};
    
position = {(GraalControl.width this.width)/2, (GraalControl.height this.height)/2};
    
canClose canMaximize canMinimize canResize false;
    
text "Zodiac Support Center; Viewing Ticket (Index:" SPC temp.id ")";
    
visible true;
    
    new 
GuiScrollCtrl("SupportTicket_Holder" temp.id)
    {
      
profile "GuiBlueScrollProfile";
      
position = {624};
      
extent = {286290};
      
hScrollBar vScrollBar "alwaysOff";
      
      new 
GuiTextCtrl("SupportTicket_SubmitterLabel" temp.id)
      {
        
profile "GuiBlueTextProfile";
        
position = {1527};
        
text "Submitted by:";
      }
      
      new 
GuiTextCtrl("SupportTicket_PriorityLabel" temp.id)
      {
        
profile "GuiBlueTextProfile";
        
position = {1567};
        
text "Priority:";
      }
      
      new 
GuiTextCtrl("SupportTicket_CategoryLabel" temp.id)
      {
        
profile "GuiBlueTextProfile";
        
position = {15107};
        
text "Category:";
      }
      
      new 
GuiTextEditCtrl("SupportTicket_FieldSumbitter-" temp.id)
      {
        
profile "GuiBlueTextEditProfile";
        
active false;
        
extent = {10525};
        
position = {16025};
        
text thiso.fields[0];
      }
      
      new 
GuiTextEditCtrl("SupportTicket_FieldPriority-" temp.id)
      {
        
profile "GuiBlueTextEditProfile";
        
active false;
        
extent = {10525};
        
position = {16065};
        
text thiso.fields[2];
      }
      
      new 
GuiTextEditCtrl("SupportTicket_FieldCategory-" temp.id)
      {
        
profile "GuiBlueTextEditProfile";
        
active false;
        
extent = {10525};
        
position = {160105};
        
text thiso.fields[1];
      }
      
      new 
GuiScrollCtrl("SupportTicket_DescriptionHold" temp.id)
      {
        
profile "GuiBlueScrollProfile";
        
position = {6150};
        
hScrollBar "alwaysOff";
        
vScrollBar "dynamic";
        
extent = {270100};
        
        new 
GuiMLTextCtrl("SupportTicket_Description-" temp.id)
        {
          
2;
          
profile "GuiBlueTextProfile";
          
width 255;
          
text thiso.fields[3];
        }
      }
    }
    
   new 
GuiButtonCtrl("SupportTicket_BtnDeleteTicket-" temp.id)
    {
      
profile "GuiBlueButtonProfile";
      
extent = {7228};
      
position = {35316};
      
text "Delete Ticket";
      
thiso.catchevent(this"onAction""DeleteTicket");
    }
    
   new 
GuiButtonCtrl("SupportTicket_BtnCloseTicket-" temp.id)
    {
      
profile "GuiBlueButtonProfile";
      
extent = {7228};
      
position = {115316};
      
text "Toggle Status";
      
thiso.catchevent(this"onAction""toggleTicket");
    }
    
    new 
GuiButtonCtrl("SupportTicket_BtnClose-" temp.id)
    {
      
profile "GuiBlueButtonProfile";
      
extent = {7228};
      
position = {195316};
      
text "Exit";
      
thiso.catchevent(this"onAction""CloseTicketWindow");
    }
  }
}

function 
CheckCode()
{
  
temp.checkcode = ("Reporter_VerifyTextCode1").text;
  return (
temp.checkcode == this.verification_code);

Reply With Quote
  #5  
Old 05-01-2007, 01:27 AM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
Append to weapon (-Complaint Reporter):
Part 4
PHP Code:
function SubmitComplaint(){
  
temp.description = ("Reporter_InputDescription").getText();
  
temp.seriousness = ("Reporter_ListSeriousness").getSelectedText();
  
temp.category = ("Reporter_InputTSelections").getSelectedText();
  
temp.checkbox = ("Reporter_AcceptTerms").checked;
  
  if (!
temp.checkbox)
    return 
drawErrorWindow("Terms""You must agree to the terms before you can submit a complaint");
    
  if (!
CheckCode()) 
    return 
drawErrorWindow("Wrong Code""You have entered the wrong verification code, please try again.");
    
  if (
temp.description.length() < this.description_minimum || temp.description.length() > this.description_maximum)
    return 
drawErrorWindow("Description"format("Your description must be over %i characters, but under %i characters."this.description_minimumthis.description_maximum));

  
triggerServer("weapon"name"RegisterComplaint"player.accounttemp.categorytemp.seriousnesstemp.description);
  
CloseSystem();
  
player.chat "Your complaint was sent, but it may not have been received.";
}

function 
ClearTicketsList(){
  
temp.listcontrol makevar("AdminCenter_List");
  
temp.listcontrol.clearrows();
}

function 
ClearMyTicketsList(){
  
temp.listcontrol makevar("SupportCenter_MyTicketList");
  
temp.listcontrol.clearrows();
}
function 
RefreshTicketsList(ticketsidlist){

  
ClearTicketsList();
  
temp.listcontrol makevar("AdminCenter_List");
  
temp.listcontrol.addRow(-1"ID" TAB "Submitter" TAB "Category" TAB "Priority" TAB "Status");
  
  for (
temp.0temp.temp.tickets.size(); temp.i++)
  {
    if (
temp.tickets[temp.i][0] == null) continue;
      
temp.listcontrol.addRow(temp.idlist[temp.i], temp.idlist[temp.iTAB temp.tickets[temp.i][0TAB temp.tickets[temp.i][1TAB temp.tickets[temp.i][2TAB temp.tickets[temp.i][4]);
  }
  
  
temp.idlist.clear();
}

function 
RefreshMyTicketsList(ticketsidlist){
  
ClearMyTicketsList();
  
temp.listcontrol makevar("SupportCenter_MyTicketList");
  
temp.listcontrol.addRow(-1"ID" TAB "Category" TAB "Priority" TAB "Status" TAB "Responses");
  
  for (
temp.0temp.temp.tickets.size(); temp.i++)
  {
    if (
temp.tickets[temp.i][0] == null) continue;
      
temp.listcontrol.addRow(temp.idlist[temp.i], temp.idlist[temp.iTAB temp.tickets[temp.i][1TAB temp.tickets[temp.i][2TAB temp.tickets[temp.i][4TAB int(temp.tickets[temp.i][5]));
  }
  
  
temp.idlist.clear();
}

function 
GetSupportTicket(id)
  
triggerServer("weapon"name"GetSupportTicket"temp.id);
  
function 
GetSupportTickets()
  
triggerServer("weapon"name"GetSupportTickets");

function 
GetMySupportTickets()
  
triggerServer("weapon"name"GetMySupportTickets");

function 
CloseSystem()
{
  
makevar("ReporterError_Window").destroy();
  
makevar("Reporter_Window").destroy();
}

function 
CloseAdminSystem()
{
  
makevar("AdminCenter_Window").destroy();
  
makevar("ReporterError_Window").destroy();
}

function 
toggleTicket(id)
{
  
temp.id temp.id.substring(("SupportTicket_BtnCloseTicket-").length());
  
ToggleTicketStatus(temp.id);
}

function 
CloseTicketWindow(control)
  
temp.control.parent.destroy();

function 
DeleteTicket(idfromplayer)
{
  
temp.did temp.id.substring(("SupportTicket_BtnDeleteTicket-").length());
  
triggerServer("weapon"name"DeleteTicket"temp.did);
  
  if (
temp.fromplayer)
    
GetMySupportTickets();
  else
    
GetSupportTickets();
    
  
temp.id.parent.destroy();
}

function 
CloseErrorWindow()
  
makevar("ReporterError_Window").destroy();

function 
ToggleTicketStatus(id)
{
  
triggerServer("weapon"name"toggleTicketStatus"temp.id);
  
GetSupportTickets();

Reply With Quote
  #6  
Old 05-01-2007, 01:30 AM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
Use and modify as you wish as long as you give credit where its due, also I didn't replace the GUI Profiles from 'Zodiac*Profile' to GuiBlue so theres something that should do.

Also, sorry for the multiple posting but the script was just too long.
Enjoy
Reply With Quote
  #7  
Old 05-01-2007, 02:59 AM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
You know, they made the forum attachments feature for a reason. You could have just added everything to a text file and attached it instead.
Reply With Quote
  #8  
Old 05-01-2007, 03:05 AM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
Quote:
Originally Posted by Gambet View Post
You know, they made the forum attachments feature for a reason. You could have just added everything to a text file and attached it instead.
Oh right, completely forgot about that.
Reply With Quote
  #9  
Old 05-01-2007, 04:02 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Rapidwolve View Post
postcount+6;
Nice script, if only the replying worked.
__________________
Reply With Quote
  #10  
Old 05-01-2007, 09:16 AM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
I feel obligated to finish my support system for Mythic and release it to the public, just to see if I would finish it with less lines then RW did.
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
  #11  
Old 05-01-2007, 09:17 AM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
It's not about the line count...
Reply With Quote
  #12  
Old 05-07-2007, 03:06 AM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
I tried making the line count as little as possible, GUI controls take alot of lines ya know.
Reply With Quote
  #13  
Old 09-01-2007, 03:50 AM
bscharff bscharff is offline
Bloo
bscharff's Avatar
Join Date: Sep 2006
Location: San Antonio, Texas
Posts: 185
bscharff has a little shameless behaviour in the past
Send a message via AIM to bscharff Send a message via MSN to bscharff Send a message via Yahoo to bscharff
Sorry, Old Thread.
It Has join("profiles");
How Do We Work Around That?

*=EDIT: Never mind!
__________________
Trying to be nice now...

Last edited by bscharff; 09-01-2007 at 04:04 AM.. Reason: *
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 01:25 PM.


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