text
stringlengths 0
15.7k
| source
stringlengths 6
112
|
---|---|
tell current application
|
Fix%20Apple%20Photos%20timestamps.scpt
|
(its (NSDictionary's dictionaryWithObjects:(item 2 of tpl) ¬
|
Fix%20Apple%20Photos%20timestamps.scpt
|
forKeys:(my map(go, item 1 of tpl)))) as record
|
Fix%20Apple%20Photos%20timestamps.scpt
|
end dictFromList
|
Fix%20Apple%20Photos%20timestamps.scpt
|
on identity(x)
|
Fix%20Apple%20Photos%20timestamps.scpt
|
end identity
|
Fix%20Apple%20Photos%20timestamps.scpt
|
on insertDict(k, v, rec)
|
Fix%20Apple%20Photos%20timestamps.scpt
|
tell dictionaryWithDictionary_(rec) of its NSMutableDictionary
|
Fix%20Apple%20Photos%20timestamps.scpt
|
its setValue:v forKey:(k as string)
|
Fix%20Apple%20Photos%20timestamps.scpt
|
it as record
|
Fix%20Apple%20Photos%20timestamps.scpt
|
end insertDict
|
Fix%20Apple%20Photos%20timestamps.scpt
|
on keys(rec)
|
Fix%20Apple%20Photos%20timestamps.scpt
|
(allKeys() of its (NSDictionary's dictionaryWithDictionary:rec)) as list
|
Fix%20Apple%20Photos%20timestamps.scpt
|
end keys
|
Fix%20Apple%20Photos%20timestamps.scpt
|
on lookUpDict(k, dct)
|
Fix%20Apple%20Photos%20timestamps.scpt
|
set ca to current application
|
Fix%20Apple%20Photos%20timestamps.scpt
|
set v to (ca's NSDictionary's dictionaryWithDictionary:dct)'s objectForKey:k
|
Fix%20Apple%20Photos%20timestamps.scpt
|
if missing value ≠ v then
|
Fix%20Apple%20Photos%20timestamps.scpt
|
Just(item 1 of ((ca's NSArray's arrayWithObject:v) as list))
|
Fix%20Apple%20Photos%20timestamps.scpt
|
Nothing()
|
Fix%20Apple%20Photos%20timestamps.scpt
|
end lookUpDict
|
Fix%20Apple%20Photos%20timestamps.scpt
|
on getFromDict(k, dct)
|
Fix%20Apple%20Photos%20timestamps.scpt
|
item 1 of ((ca's NSArray's arrayWithObject:v) as list)
|
Fix%20Apple%20Photos%20timestamps.scpt
|
end getFromDict
|
Fix%20Apple%20Photos%20timestamps.scpt
|
on map(f, xs)
|
Fix%20Apple%20Photos%20timestamps.scpt
|
set end of lst to |λ|(item i of xs, i, xs)
|
Fix%20Apple%20Photos%20timestamps.scpt
|
return lst
|
Fix%20Apple%20Photos%20timestamps.scpt
|
end map
|
Fix%20Apple%20Photos%20timestamps.scpt
|
on maybe(v, f, mb)
|
Fix%20Apple%20Photos%20timestamps.scpt
|
if Nothing of mb then
|
Fix%20Apple%20Photos%20timestamps.scpt
|
v
|
Fix%20Apple%20Photos%20timestamps.scpt
|
tell mReturn(f) to |λ|(Just of mb)
|
Fix%20Apple%20Photos%20timestamps.scpt
|
end maybe
|
Fix%20Apple%20Photos%20timestamps.scpt
|
if script is class of f then
|
Fix%20Apple%20Photos%20timestamps.scpt
|
on unzip(xys)
|
Fix%20Apple%20Photos%20timestamps.scpt
|
set xs to {}
|
Fix%20Apple%20Photos%20timestamps.scpt
|
set ys to {}
|
Fix%20Apple%20Photos%20timestamps.scpt
|
repeat with xy in xys
|
Fix%20Apple%20Photos%20timestamps.scpt
|
set end of xs to item 1 of xy
|
Fix%20Apple%20Photos%20timestamps.scpt
|
set end of ys to item 2 of xy
|
Fix%20Apple%20Photos%20timestamps.scpt
|
return {xs, ys}
|
Fix%20Apple%20Photos%20timestamps.scpt
|
end unzip
|
Fix%20Apple%20Photos%20timestamps.scpt
|
on zip(xs, ys)
|
Fix%20Apple%20Photos%20timestamps.scpt
|
set lng to min(length of xs, length of ys)
|
Fix%20Apple%20Photos%20timestamps.scpt
|
set end of lst to {item i of xs, item i of ys}
|
Fix%20Apple%20Photos%20timestamps.scpt
|
end zip
|
Fix%20Apple%20Photos%20timestamps.scpt
|
set huntingEnabled to true
|
bot.applescript
|
set fishingEnabled to true
|
bot.applescript
|
set huntingCooldown to 7 --Delay time set by bot.
|
bot.applescript
|
set fishingCooldown to 20 --Delay time set by bot.
|
bot.applescript
|
set latencyOffset to 0.5 --Base adjustment for discord lag
|
bot.applescript
|
set serverRateLimit to 6
|
bot.applescript
|
global huntingEnabled, fishingEnabled, huntingCooldown, fishingCooldown
|
bot.applescript
|
global latencyOffset, serverRateLimit
|
bot.applescript
|
set hunt to ";p"
|
bot.applescript
|
set fish to ";f"
|
bot.applescript
|
set captchaTriggers to {hunt, fish}
|
bot.applescript
|
global captchaTriggers
|
bot.applescript
|
set msgCaptcha to "captcha"
|
bot.applescript
|
set msgWait to "please wait"
|
bot.applescript
|
set msgWildpokemon to "A wild Pokémon appeared!"
|
bot.applescript
|
set msgStreak to {"Uncommon streak: 6", "Uncommon streak: 7", "Uncommon streak: 8", "Uncommon streak: 9", "Common streak: 13", "Common streak: 14"}
|
bot.applescript
|
set msgWildcaught to "Congratulations, "
|
bot.applescript
|
set msgWildescaped to " used a"
|
bot.applescript
|
set msgFishingpokemon to "A wild Pokemon appeared!"
|
bot.applescript
|
set msgFishingpull to "Oh! A bite!"
|
bot.applescript
|
set msgFishingnothing to "Not even a nibble"
|
bot.applescript
|
global msgCaptcha, msgWait, msgWildpokemon, msgWildcaught, msgStreak
|
bot.applescript
|
global msgWildescaped, msgFishingpokemon, msgFishingpull, msgFishingnothing
|
bot.applescript
|
set msgRCommon to "Common streak"
|
bot.applescript
|
set msgRUncommon to "Uncommon streak"
|
bot.applescript
|
set msgRRare to "Rare streak"
|
bot.applescript
|
set msgRSuper to "Super Rare streak"
|
bot.applescript
|
set msgRLegendary to "Legendary streak"
|
bot.applescript
|
set msgRShiny to "Shiny streak"
|
bot.applescript
|
set msgRGolden to "Golden streak" --Hypothetically...
|
bot.applescript
|
global msgRCommon, msgRUncommon, msgRRare, msgRSuper
|
bot.applescript
|
global msgRLegendary, msgRShiny, msgRGolden
|
bot.applescript
|
set lastRequest to ""
|
bot.applescript
|
set botStatus to ""
|
bot.applescript
|
set lastHunting to huntingCooldown
|
bot.applescript
|
set lastFishing to fishingCooldown
|
bot.applescript
|
global lastRequest, botStatus, lastHunting, lastFishing
|
bot.applescript
|
tell application "Google Chrome" to activate
|
bot.applescript
|
if huntingEnabled and getTime() ≥ (lastHunting + huntingCooldown + latencyOffset) then
|
bot.applescript
|
log "Time between hunting: " & (getTime() - lastHunting)
|
bot.applescript
|
sendRequest(hunt)
|
bot.applescript
|
waitFor({msgWildpokemon})
|
bot.applescript
|
if botStatus contains msgWildpokemon then throwPokeball()
|
bot.applescript
|
set lastHunting to getTime()
|
bot.applescript
|
delay latencyOffset
|
bot.applescript
|
if fishingEnabled and getTime() ≥ (lastFishing + fishingCooldown + latencyOffset) then
|
bot.applescript
|
log "Time between fishing: " & (getTime() - lastFishing)
|
bot.applescript
|
set offsetTimer to getTime()
|
bot.applescript
|
sendRequest(fish)
|
bot.applescript
|
waitFor({msgFishingpull, msgFishingnothing})
|
bot.applescript
|
if botStatus contains msgFishingpull then
|
bot.applescript
|
tell application "System Events" to keystroke "pull"
|
bot.applescript
|
tell application "System Events" to key code 76
|
bot.applescript
|
waitFor({msgFishingpokemon})
|
bot.applescript
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.