-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathAbyte0_BettyEyesShopper.java
More file actions
186 lines (174 loc) · 3.41 KB
/
Abyte0_BettyEyesShopper.java
File metadata and controls
186 lines (174 loc) · 3.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
public class Abyte0_BettyEyesShopper extends Abyte0_Script
{
int betty = 149;
int coins = 10;
int eyes = 270;
int fMode = 3;
boolean buyRunes = true;
private final String SCRIPT_VERSION = "1.0";
public Abyte0_BettyEyesShopper(Extension e)
{
super(e);
}
public void init( String params )
{
print("Started Abyte0 Betty Eyes Shopper");
print("Version "+ SCRIPT_VERSION);
print("Any param = Eyes only");
print("No param = Eyes + runes");
if(params.equals(""))
buyRunes = true;
else
buyRunes = false;
}
public int main()
{
if(getFightMode() != fMode)
{
setFightMode(fMode);
}
if(isBanking())
{
for(int i = 31; i<37; i++)
{
if(getInventoryCount(i) > 0)
{
deposit(i,getInventoryCount(i));
return 100;
}
}
if(getInventoryCount(eyes) > 0)
{
deposit(eyes,1);
return 100;
}
if(getInventoryCount(coins) < 2500)
{
withdraw(coins,25000);
return 1000;
}
closeBank();
return 1000;
}
if(isQuestMenu())
{
answer(0);
return 1000 + random(300, 1200);
}
if(getInventoryCount() == 30 || getInventoryCount(coins) < 10)
{
if(getY() > 629)
{
walkTo(278,629);
return 1000;
}
while(getY() > 575)
{
walkTo(290,getY()-3);
return 500;
}
if(getX() == 287 && getY() == 572)
{
//Si a coter de la porte a exterieur
print("Step Inside Bank");
//atObject(287,571);
walkTo(286,571);
return 3000;
}
if(getX() >= 280 && getX() <= 286 && getY() >= 564 && getY() <= 573)
{
//Si dans la banque
print("Talking to Banker");
if(!isBanking())
{
int banker[] = getNpcByIdNotTalk(new int[]{95});
if (banker[0] != -1 && !isBanking())
{
talkToNpc(banker[0]);
return 3000;
}
}
return 1000;
}
if(getY() < 575)
{
walkTo(287,572);
return 1000 + random(300, 1200);
}
print("Walking to 287,571");
walkTo(287,571);
return 1000 + random(300, 1200);
}
else
{
if(shopWindowOpen())
{
//then we close the shop
if(getInventoryCount() == 30)
{
closeShop();
return 2500;
}
if(buyRunes)
{
for(int i = 31; i<36; i++)
{
if(getShopItemIdAmount(i) > 0)
{
buyItemIdFromShop(i,50);
return 200;
}
}
}
buyItemIdFromShop(eyes,1);
return 100;
}
if(getX() == 286 && getY() == 571)
{
//Si a coter de la porte a linterieur
print("Step Outside Bank");
//atObject(287,571);
walkTo(287,571);
return random(121, 3500);
}
if(getX() >= 280 && getX() <= 286 && getY() >= 564 && getY() <= 573)
{
//Si dans la banque
print("Walking to Door");
walkTo(286,571);
return random(240, 2500);
}
while(getY() < 620)
{
walkTo(290,getY()+3);
return 500;
}
if(getY() < 628)
{
walkTo(285,628);
return 3000;
}
if(getX() > 274)
{
walkTo(getX()-2,629);
return 1000;
}
if(getX() <= 274)
{
int bettyRef[] = getNpcByIdNotTalk(new int[]{betty});
if (bettyRef[0] != -1)
{
talkToNpc(bettyRef[0]);
return 2500;
}
return 3000;
}
return 5000;
}
}
@Override
public String getSctiptVersion()
{
return SCRIPT_VERSION;
}
}