Advertisement
Guest User

DStunAlcher.java

a guest
Jul 5th, 2016
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.03 KB | None | 0 0
  1. package scripts;
  2.  
  3. import java.awt.Color;
  4. import java.awt.Font;
  5. import java.awt.Graphics;
  6. import java.awt.Graphics2D;
  7. import java.awt.Image;
  8. import java.awt.RenderingHints;
  9. import java.io.IOException;
  10. import java.net.URL;
  11. import java.util.ArrayList;
  12.  
  13. import java.awt.*;
  14. import java.awt.event.*;
  15. import javax.swing.*;
  16. import javax.swing.GroupLayout;
  17. import javax.swing.LayoutStyle;
  18. import javax.swing.border.*;
  19.  
  20. import javax.imageio.ImageIO;
  21.  
  22. import org.tribot.api.General;
  23. import org.tribot.api.input.Mouse;
  24. import org.tribot.api2007.Camera;
  25. import org.tribot.api2007.Game;
  26. import org.tribot.api2007.GameTab;
  27. import org.tribot.api2007.Inventory;
  28. import org.tribot.api2007.Login;
  29. import org.tribot.api2007.Magic;
  30. import org.tribot.api2007.NPCs;
  31. import org.tribot.api2007.Skills;
  32. import org.tribot.api2007.Skills.SKILLS;
  33. import org.tribot.api2007.GameTab.TABS;
  34. import org.tribot.api2007.types.RSItem;
  35. import org.tribot.api2007.types.RSNPC;
  36. import org.tribot.script.Script;
  37. import org.tribot.script.ScriptManifest;
  38. import org.tribot.script.interfaces.Painting;
  39.  
  40. import scripts.DTools.DAntiban;
  41. import scripts.DTools.DTimer;
  42.  
  43. @ScriptManifest(authors = { "TheD" }, category = "TheDScripts", name = "DStunAlcher")
  44. public class DStunAlcher extends Script implements Painting
  45. {
  46.  
  47. private long startNewsTime = System.currentTimeMillis();
  48. private String alch_item_name = "";
  49. private String NPC_TO_STUN = "";
  50. private String alchSpell = "";
  51. private String stunSpell= "";
  52.  
  53. private int task = 1;
  54. private int waited = 0;
  55. private int to_wait = 0;
  56. private boolean ABC2 = true;
  57. private boolean ABC2_reactions = true;
  58. private ArrayList<String> latestNews = new ArrayList<String>();
  59. private final Font font2 = new Font("Arial", Font.BOLD, 14);
  60. private final Font font3 = new Font("Arial", 1, 16);
  61. private State scriptState = State.NOTHING;
  62. private int magiclvl = 0;
  63. private int magicxp = 0;
  64.  
  65. private boolean GUIWait = true;
  66. private GUI g = new GUI();
  67.  
  68. private boolean castsecondspell = false;
  69. private boolean castfirstspell = false;
  70.  
  71. private enum State { NOTHING,ALCH,STUN
  72.  
  73. };
  74.  
  75. @Override
  76. public void run()
  77. {
  78. //BEFORE GUI
  79. this.setLoginBotState(false);
  80. g.setVisible(true);
  81. while(GUIWait == true)
  82. {
  83. sleep(500);
  84. if(!GUIWait) break;
  85. }
  86. DTimer.startScriptTimer();
  87. sleep(500);
  88. DTimer.callGUI();
  89. //AFTER GUI
  90. Mouse.setSpeed(General.random(150, 160));
  91. General.useAntiBanCompliance(true);
  92. to_wait = General.random(10, 40);
  93. DAntiban.timedActions();
  94. DAntiban.generateTrackers(500);
  95. this.setLoginBotState(true);
  96. if(Login.getLoginState() == Login.STATE.INGAME)
  97. {
  98. magiclvl = Skills.getActualLevel(SKILLS.MAGIC);
  99. magicxp = Skills.getXP(SKILLS.MAGIC);
  100. }
  101.  
  102. while(true)
  103. {
  104. if(ABC2) DAntiban.timedActions();
  105. loop();
  106. sleep(50,200);
  107. if(DTimer.checkEndTimer()) //returns true if we succesfully logged out & are not in combat
  108. {
  109. this.stopScript();
  110. }
  111. }
  112.  
  113. }
  114.  
  115. private void loop()
  116. {
  117. scriptState = getState();
  118. switch(scriptState)
  119. {
  120. case ALCH:
  121.  
  122. if(GameTab.getOpen() != TABS.MAGIC) { waited++; if(waited < to_wait) { to_wait = General.random(10, 40); break; }}
  123. if(Magic.isSpellSelected() && Magic.getSelectedSpellName().contains(stunSpell)) { task = 2; break; }
  124. if(Game.getUptext().startsWith("Cast "+alchSpell+" / 1") || !Game.getUptext().startsWith("Cast "+alchSpell) || !Magic.getSelectedSpellName().contains(alchSpell)) Magic.selectSpell(alchSpell);
  125. if(GameTab.getOpen() != TABS.INVENTORY) break;
  126. RSItem[] item_to_alch = Inventory.find(alch_item_name);
  127. if(item_to_alch.length > 0)
  128. {
  129. DAntiban.sleep(General.random(1, 4));
  130. item_to_alch[0].click("Cast "+alchSpell+" -> "+item_to_alch[0].getDefinition().getName());
  131. }
  132. waited = 0;
  133. if(castsecondspell) task = 2;
  134. if(!ABC2_reactions) DAntiban.smartSleep(750);
  135. dynamicSleep();
  136. break;
  137.  
  138. case STUN:
  139. if(GameTab.getOpen() != TABS.MAGIC) { waited++; if(waited < to_wait) { to_wait = General.random(10, 40); break; }}
  140. if(Magic.isSpellSelected() && Magic.getSelectedSpellName().contains(alchSpell)) { task = 1; break; }
  141. if(!Game.getUptext().equals("Cast "+stunSpell+"") || Magic.getSelectedSpellName() == null || !Magic.getSelectedSpellName().contains(stunSpell)) { Magic.selectSpell(stunSpell);}
  142. DAntiban.sleep(General.random(3, 11));
  143. if(Magic.isSpellSelected())
  144. {
  145. RSNPC[] npc_to_stun = NPCs.findNearest(NPC_TO_STUN);
  146. if(npc_to_stun.length > 0)
  147. {
  148. RSNPC stunNPC = null;
  149. if(npc_to_stun[0] != null) stunNPC = npc_to_stun[0];
  150. if(stunNPC != null && !stunNPC.getPosition().isOnScreen()) Camera.turnToTile(stunNPC.getPosition());
  151. stunNPC.click("Cast "+stunSpell+" -> "+stunNPC.getDefinition().getName());
  152. }
  153. }
  154. waited = 0;
  155. if(castfirstspell) task = 1;
  156. if(!ABC2_reactions) DAntiban.smartSleep(600);
  157. dynamicSleep();
  158. break;
  159.  
  160. case NOTHING:
  161.  
  162. break;
  163. }
  164. }
  165.  
  166. private State getState()
  167. {
  168. if(castfirstspell && Inventory.find(alch_item_name).length > 0 && Inventory.find("Nature rune").length > 0 && (task == 1 || NPCs.find(NPC_TO_STUN).length < 1))
  169. return State.ALCH;
  170. if(castsecondspell && NPCs.findNearest(NPC_TO_STUN).length > 0 && Inventory.find("Soul rune").length > 0 && (task == 2 || Inventory.find(alch_item_name).length < 1 || Inventory.find("Nature rune").length < 1))
  171. return State.STUN;
  172. return State.NOTHING;
  173. }
  174.  
  175. private void dynamicSleep()
  176. {
  177. if(ABC2_reactions && castsecondspell && castfirstspell)
  178. {
  179. DAntiban.generateTrackers(400);
  180. DAntiban.timedActions();
  181. DAntiban.sleepReactionTime();
  182. }
  183. else if(!ABC2_reactions && !castsecondspell && castfirstspell)
  184. {
  185. sleep(500,1200);
  186. }
  187. else if(ABC2_reactions && !castsecondspell && castfirstspell)
  188. {
  189. DAntiban.generateTrackers(1000);
  190. DAntiban.timedActions();
  191. DAntiban.sleepReactionTime();
  192. }
  193. else if(ABC2_reactions && !castfirstspell && castsecondspell)
  194. {
  195. DAntiban.generateTrackers(500);
  196. DAntiban.timedActions();
  197. DAntiban.sleepReactionTime();
  198. }
  199. else if(!ABC2_reactions && !castfirstspell && castsecondspell)
  200. {
  201. sleep(500,2000);
  202. }
  203. }
  204.  
  205. int newsToShow = 0;
  206.  
  207. private void getnewsdata()
  208. {
  209. int newsTimer = (int) (System.currentTimeMillis() - startNewsTime) / 1000;
  210. if(newsTimer > 8)
  211. {
  212. startNewsTime = System.currentTimeMillis();
  213. if(newsToShow == (latestNews.size() -1)) newsToShow = 0;
  214. else if(newsToShow < (latestNews.size())) newsToShow++;
  215.  
  216. }
  217.  
  218. }
  219.  
  220. private Image getImage(String url)
  221. {
  222. try
  223. {
  224. return ImageIO.read(new URL(url));
  225. }
  226. catch(IOException e)
  227. {
  228. return null;
  229. }
  230. }
  231.  
  232. private int xpPH = 0;
  233. private int xpGot = 0;
  234. private int magiclvlsgained = 0;
  235.  
  236. private void calculatePaint()
  237. {
  238. xpGot = (Skills.getXP(SKILLS.MAGIC) - magicxp);
  239. xpPH = DTimer.getPH(xpGot);
  240. magiclvlsgained = Skills.getActualLevel(SKILLS.MAGIC)-magiclvl;
  241. }
  242.  
  243.  
  244. private final Image dchickenspaintimg = getImage("http://d-scripting.com/DEssentials/paint/dstunalcherpaint.png");
  245. private final RenderingHints aa = new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
  246. private final Color darkred = new Color(193,48,38);
  247. int paintOffset = 320;
  248.  
  249. @Override
  250. public void onPaint(Graphics g)
  251. {
  252. if(GUIWait) return;
  253. getnewsdata();
  254. calculatePaint();
  255. Graphics2D g2 = (Graphics2D)g;
  256. g2.setRenderingHints(aa);
  257. g2.drawImage(dchickenspaintimg, 0, paintOffset, null);
  258. g.setColor(Color.CYAN);
  259. g.setFont(font3);
  260. if(newsToShow < (latestNews.size())) g.drawString("NEWS: "+ latestNews.get(newsToShow), 40,40);
  261. g.setColor(darkred);
  262. g.setFont(font2);
  263. g.drawString("Time ran: "+ DTimer.getHour() + ":" + DTimer.getMinute() + ":" + DTimer.getSecond(), 5,paintOffset+60);
  264. g.drawString("Magic level: "+Skills.getActualLevel(SKILLS.MAGIC)+" (+"+magiclvlsgained+")", 5,paintOffset+75);
  265. g.drawString("Magic XP gained: "+xpGot+" ("+xpPH+" p/h)", 5,paintOffset+90);
  266. if(DTimer.getEndAfterTime()) g.drawString("Ending script when we ran "+(DTimer.getEndHour())+":"+(DTimer.getEndMinute())+":"+(DTimer.getEndSeconds())+" (HH:MM:SS)", 5,paintOffset+105);
  267. if(!DTimer.getEndAfterTime()) g.drawString("Not using End-timer or not yet set-up", 5,paintOffset+105);
  268. g.drawString("State: "+scriptState, 5,paintOffset+120);
  269. g.drawString("Version: 1.00", 5,paintOffset+160);
  270.  
  271. }
  272.  
  273. public class GUI extends JFrame {
  274. public GUI() {
  275. initComponents();
  276. }
  277.  
  278. private void StartScriptButtonActionPerformed(ActionEvent e)
  279. {
  280. ABC2 = useABC2.isSelected();
  281. ABC2_reactions = abc2ReactionTimes.isSelected();
  282. castfirstspell = castFirstSpell.isSelected();
  283. castsecondspell = castSecondSpell.isSelected();
  284. alch_item_name = itemToAlchName.getText();
  285. NPC_TO_STUN = npctostunName.getText();
  286. String alchToCast = alchType.getSelectedItem().toString();
  287. String secondSpellToCast = secondSpell.getSelectedItem().toString();
  288. if(alchToCast.startsWith("1. ")) alchSpell = "Low Level Alchemy";
  289. if(alchToCast.startsWith("2. ")) alchSpell = "High Level Alchemy";
  290. if(secondSpellToCast.startsWith("1. ")) stunSpell = "Confuse";
  291. if(secondSpellToCast.startsWith("2. ")) stunSpell = "Weaken";
  292. if(secondSpellToCast.startsWith("3. ")) stunSpell = "Curse";
  293. if(secondSpellToCast.startsWith("4. ")) stunSpell = "Vulnerability";
  294. if(secondSpellToCast.startsWith("5. ")) stunSpell = "Enfeeble";
  295. if(secondSpellToCast.startsWith("6. ")) stunSpell = "Stun";
  296. GUIWait = false;
  297. g.dispose();
  298. }
  299.  
  300. private void DScriptingdotcomActionPerformed(ActionEvent e)
  301. {
  302. DTimer.openSite("http://www.d-scripting.com/");
  303. }
  304.  
  305. private void visitDTribotPofileActionPerformed(ActionEvent e)
  306. {
  307. DTimer.openSite("https://tribot.org/forums/profile/8498-thed/");
  308. }
  309.  
  310. private void moreDScriptsActionPerformed(ActionEvent e)
  311. {
  312. DTimer.openSite("http://d-scripting.com/more");
  313. }
  314.  
  315. private void initComponents() {
  316. menuBar1 = new JMenuBar();
  317. menu1 = new JMenu();
  318. DScriptingdotcom = new JMenuItem();
  319. visitDTribotPofile = new JMenuItem();
  320. moreDScripts = new JMenuItem();
  321. dialogPane = new JPanel();
  322. contentPanel = new JPanel();
  323. label1 = new JLabel();
  324. label2 = new JLabel();
  325. itemToAlchName = new JTextField();
  326. label3 = new JLabel();
  327. alchType = new JComboBox<>();
  328. label4 = new JLabel();
  329. secondSpell = new JComboBox<>();
  330. useABC2 = new JCheckBox();
  331. abc2ReactionTimes = new JCheckBox();
  332. label5 = new JLabel();
  333. npctostunName = new JTextField();
  334. castSecondSpell = new JCheckBox();
  335. castFirstSpell = new JCheckBox();
  336. buttonBar = new JPanel();
  337. StartScriptButton = new JButton();
  338.  
  339. //======== this ========
  340. setAlwaysOnTop(true);
  341. setResizable(false);
  342. setTitle("DScripts by TheD");
  343. Container contentPane = getContentPane();
  344. contentPane.setLayout(new BorderLayout());
  345.  
  346. //======== menuBar1 ========
  347. {
  348.  
  349. //======== menu1 ========
  350. {
  351. menu1.setText("General");
  352.  
  353. //---- DScriptingdotcom ----
  354. DScriptingdotcom.setText("D-Scripting.com");
  355. DScriptingdotcom.addActionListener(e -> DScriptingdotcomActionPerformed(e));
  356. menu1.add(DScriptingdotcom);
  357.  
  358. //---- visitDTribotPofile ----
  359. visitDTribotPofile.setText("Visit TheD's TRiBot Profile");
  360. visitDTribotPofile.addActionListener(e -> visitDTribotPofileActionPerformed(e));
  361. menu1.add(visitDTribotPofile);
  362.  
  363. //---- moreDScripts ----
  364. moreDScripts.setText("More DScripts");
  365. moreDScripts.addActionListener(e -> moreDScriptsActionPerformed(e));
  366. menu1.add(moreDScripts);
  367. }
  368. menuBar1.add(menu1);
  369. }
  370. setJMenuBar(menuBar1);
  371.  
  372. //======== dialogPane ========
  373. {
  374. dialogPane.setBorder(new EmptyBorder(12, 12, 12, 12));
  375.  
  376. //DScripting mark
  377. dialogPane.setBorder(new javax.swing.border.CompoundBorder(
  378. new javax.swing.border.TitledBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0),
  379. "DScripting Limited", javax.swing.border.TitledBorder.CENTER,
  380. javax.swing.border.TitledBorder.BOTTOM, new java.awt.Font("Dialog", java.awt.Font.BOLD, 12),
  381. java.awt.Color.red), dialogPane.getBorder())); dialogPane.addPropertyChangeListener(new java.beans.PropertyChangeListener(){public void propertyChange(java.beans.PropertyChangeEvent e){if("border".equals(e.getPropertyName()))throw new RuntimeException();}});
  382.  
  383. dialogPane.setLayout(new BorderLayout());
  384.  
  385. //======== contentPanel ========
  386. {
  387.  
  388. //---- label1 ----
  389. label1.setText("DStunAlcher");
  390. label1.setFont(new Font("Tahoma", Font.PLAIN, 48));
  391.  
  392. //---- label2 ----
  393. label2.setText("Item to alch name (Exact):");
  394. label2.setFont(new Font("Tahoma", Font.PLAIN, 12));
  395.  
  396. //---- itemToAlchName ----
  397. itemToAlchName.setFont(new Font("Tahoma", Font.PLAIN, 12));
  398.  
  399. //---- label3 ----
  400. label3.setText("Type of alch:");
  401. label3.setFont(new Font("Tahoma", Font.PLAIN, 12));
  402.  
  403. //---- alchType ----
  404. alchType.setFont(new Font("Tahoma", Font.PLAIN, 12));
  405. alchType.setModel(new DefaultComboBoxModel<>(new String[] {
  406. "1. Low alchemy",
  407. "2. High alchemy"
  408. }));
  409. alchType.setSelectedIndex(1);
  410.  
  411. //---- label4 ----
  412. label4.setText("Type of secondary spell:");
  413. label4.setFont(new Font("Tahoma", Font.PLAIN, 12));
  414.  
  415. //---- secondSpell ----
  416. secondSpell.setFont(new Font("Tahoma", Font.PLAIN, 12));
  417. secondSpell.setModel(new DefaultComboBoxModel<>(new String[] {
  418. "1. Confuse",
  419. "2. Weaken",
  420. "3. Curse",
  421. "4. Vulnerability",
  422. "5. Enfeeble",
  423. "6. Stun"
  424. }));
  425. secondSpell.setSelectedIndex(3);
  426.  
  427. //---- useABC2 ----
  428. useABC2.setText("Use ABC2");
  429. useABC2.setSelected(true);
  430. useABC2.setFont(new Font("Tahoma", Font.PLAIN, 12));
  431.  
  432. //---- abc2ReactionTimes ----
  433. abc2ReactionTimes.setText("Use ABC2 Reaction times");
  434. abc2ReactionTimes.setFont(new Font("Tahoma", Font.PLAIN, 12));
  435.  
  436. //---- label5 ----
  437. label5.setText("NPC name to Stun (Exact):");
  438. label5.setFont(new Font("Tahoma", Font.PLAIN, 12));
  439.  
  440. //---- npctostunName ----
  441. npctostunName.setFont(new Font("Tahoma", Font.PLAIN, 12));
  442.  
  443. //---- castSecondSpell ----
  444. castSecondSpell.setText("Do the following:");
  445. castSecondSpell.setFont(new Font("Tahoma", Font.PLAIN, 12));
  446. castSecondSpell.setSelected(true);
  447.  
  448. //---- castFirstSpell ----
  449. castFirstSpell.setText("Do the following:");
  450. castFirstSpell.setFont(new Font("Tahoma", Font.PLAIN, 12));
  451. castFirstSpell.setSelected(true);
  452.  
  453. GroupLayout contentPanelLayout = new GroupLayout(contentPanel);
  454. contentPanel.setLayout(contentPanelLayout);
  455. contentPanelLayout.setHorizontalGroup(
  456. contentPanelLayout.createParallelGroup()
  457. .addGroup(contentPanelLayout.createSequentialGroup()
  458. .addComponent(label1)
  459. .addGap(0, 234, Short.MAX_VALUE))
  460. .addGroup(contentPanelLayout.createSequentialGroup()
  461. .addContainerGap()
  462. .addGroup(contentPanelLayout.createParallelGroup()
  463. .addGroup(contentPanelLayout.createSequentialGroup()
  464. .addComponent(useABC2)
  465. .addGap(18, 18, 18)
  466. .addComponent(abc2ReactionTimes))
  467. .addGroup(contentPanelLayout.createSequentialGroup()
  468. .addGroup(contentPanelLayout.createParallelGroup()
  469. .addGroup(contentPanelLayout.createSequentialGroup()
  470. .addComponent(label4)
  471. .addGap(11, 11, 11))
  472. .addGroup(GroupLayout.Alignment.TRAILING, contentPanelLayout.createSequentialGroup()
  473. .addComponent(label5)
  474. .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)))
  475. .addGroup(contentPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING, false)
  476. .addComponent(secondSpell, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
  477. .addComponent(npctostunName, GroupLayout.PREFERRED_SIZE, 200, GroupLayout.PREFERRED_SIZE)
  478. .addComponent(castSecondSpell)))
  479. .addGroup(contentPanelLayout.createSequentialGroup()
  480. .addGroup(contentPanelLayout.createParallelGroup()
  481. .addComponent(label2)
  482. .addComponent(label3))
  483. .addGap(11, 11, 11)
  484. .addGroup(contentPanelLayout.createParallelGroup()
  485. .addComponent(alchType, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
  486. .addComponent(itemToAlchName, GroupLayout.PREFERRED_SIZE, 200, GroupLayout.PREFERRED_SIZE)
  487. .addComponent(castFirstSpell))))
  488. .addContainerGap(125, Short.MAX_VALUE))
  489. );
  490. contentPanelLayout.setVerticalGroup(
  491. contentPanelLayout.createParallelGroup()
  492. .addGroup(contentPanelLayout.createSequentialGroup()
  493. .addComponent(label1)
  494. .addGap(18, 18, 18)
  495. .addComponent(castFirstSpell)
  496. .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 12, Short.MAX_VALUE)
  497. .addGroup(contentPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
  498. .addComponent(label3)
  499. .addComponent(alchType, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
  500. .addGap(2, 2, 2)
  501. .addGroup(contentPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
  502. .addComponent(itemToAlchName, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
  503. .addComponent(label2))
  504. .addGap(18, 18, 18)
  505. .addComponent(castSecondSpell)
  506. .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
  507. .addGroup(contentPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
  508. .addComponent(label4)
  509. .addComponent(secondSpell, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
  510. .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
  511. .addGroup(contentPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
  512. .addComponent(npctostunName, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
  513. .addComponent(label5))
  514. .addGap(18, 18, 18)
  515. .addGroup(contentPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
  516. .addComponent(useABC2)
  517. .addComponent(abc2ReactionTimes))
  518. .addContainerGap())
  519. );
  520. }
  521. dialogPane.add(contentPanel, BorderLayout.CENTER);
  522.  
  523. //======== buttonBar ========
  524. {
  525. buttonBar.setBorder(new EmptyBorder(12, 0, 0, 0));
  526. buttonBar.setLayout(new GridBagLayout());
  527. ((GridBagLayout)buttonBar.getLayout()).columnWidths = new int[] {0, 80};
  528. ((GridBagLayout)buttonBar.getLayout()).columnWeights = new double[] {1.0, 0.0};
  529.  
  530. //---- StartScriptButton ----
  531. StartScriptButton.setText("Start Script");
  532. StartScriptButton.addActionListener(e -> StartScriptButtonActionPerformed(e));
  533. buttonBar.add(StartScriptButton, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0,
  534. GridBagConstraints.CENTER, GridBagConstraints.BOTH,
  535. new Insets(0, 0, 0, 0), 0, 0));
  536. }
  537. dialogPane.add(buttonBar, BorderLayout.SOUTH);
  538. }
  539. contentPane.add(dialogPane, BorderLayout.CENTER);
  540. pack();
  541. setLocationRelativeTo(getOwner());
  542. }
  543.  
  544. private JMenuBar menuBar1;
  545. private JMenu menu1;
  546. private JMenuItem DScriptingdotcom;
  547. private JMenuItem visitDTribotPofile;
  548. private JMenuItem moreDScripts;
  549. private JPanel dialogPane;
  550. private JPanel contentPanel;
  551. private JLabel label1;
  552. private JLabel label2;
  553. private JTextField itemToAlchName;
  554. private JLabel label3;
  555. private JComboBox<String> alchType;
  556. private JLabel label4;
  557. private JComboBox<String> secondSpell;
  558. private JCheckBox useABC2;
  559. private JCheckBox abc2ReactionTimes;
  560. private JLabel label5;
  561. private JTextField npctostunName;
  562. private JCheckBox castSecondSpell;
  563. private JCheckBox castFirstSpell;
  564. private JPanel buttonBar;
  565. private JButton StartScriptButton;
  566. //END OF GUI
  567. }
  568. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement